home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cxl50.arc / CXL.DOC next >
Text File  |  1989-07-11  |  254KB  |  8,759 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                                     C X L
  25.  
  26.                  The C Programmer's Extended Function Library
  27.  
  28.                                  Version 5.0
  29.  
  30.                                 March 27, 1989
  31.  
  32.                                by Mike Smedley
  33.  
  34.                  Copyright (c) 1987-1989  All Rights Reserved
  35.  
  36.                                Reference Manual
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                               Table of Contents
  64.  
  65.                  Introduction................................1
  66.                       General Information....................1
  67.                       Features of the CXL Library............1
  68.                       Registration Information...............3
  69.                       How to Contact the Author..............5
  70.                       Disclaimer.............................5
  71.                       Trademarks.............................5
  72.                       Using CXL Functions....................6
  73.                  Global Variables............................7
  74.                       _kbinfo................................7
  75.                       _mouse.................................7
  76.                       _vinfo.................................7
  77.                       _winfo.................................8
  78.                  Library Functions..........................10
  79.                       attrib................................10
  80.                       beep..................................10
  81.                       biosver...............................10
  82.                       box_..................................11
  83.                       capsoff...............................11
  84.                       capson................................12
  85.                       cclrscrn..............................12
  86.                       clearkeys.............................12
  87.                       clockcal..............................13
  88.                       clreol_...............................13
  89.                       clrscrn...............................13
  90.                       clrwin................................13
  91.                       cvaltype..............................14
  92.                       cvtcf.................................14
  93.                       cvtci.................................15
  94.                       cvtfc.................................15
  95.                       cvtic.................................16
  96.                       cxlver................................16
  97.                       delay_................................17
  98.                       disktoscrn............................17
  99.                       disktowin.............................18
  100.                       EMS Functions.........................18
  101.                       emsalloc..............................19
  102.                       emsdealloc............................20
  103.                       emsexist..............................20
  104.                       emsframe..............................21
  105.                       emsfree...............................21
  106.                       emsmap................................21
  107.                       emsread...............................22
  108.                       emstotal..............................22
  109.                       emsver................................23
  110.                       emswrite..............................23
  111.                       expmem................................23
  112.                       extmem................................24
  113.                       fcrypt................................24
  114.                       fill_.................................25
  115.                       gameport..............................25
  116.                       getchf................................26
  117.  
  118.  
  119.  
  120.                                       i
  121.  
  122.  
  123.                       getcursz..............................26
  124.                       getns.................................27
  125.                       getxch................................27
  126.                       gotoxy_...............................28
  127.                       hidecur...............................28
  128.                       inputsf...............................28
  129.                       kbclear...............................29
  130.                       kbmhit................................29
  131.                       kbput.................................30
  132.                       kbputs................................30
  133.                       kbstat................................31
  134.                       lcrlf.................................31
  135.                       lgcursor..............................32
  136.                       lprintc...............................32
  137.                       lprintf...............................32
  138.                       lprintns..............................33
  139.                       lprints...............................33
  140.                       lprintsb..............................34
  141.                       lprintsu..............................34
  142.                       machid................................34
  143.                       mapattr...............................35
  144.                       mathchip..............................35
  145.                       mode..................................36
  146.                       msbclear..............................36
  147.                       msbpress..............................36
  148.                       msbreles..............................37
  149.                       mscondoff.............................38
  150.                       mscursor..............................38
  151.                       msgotoxy..............................39
  152.                       mshbounds.............................39
  153.                       mshidecur.............................40
  154.                       msinit................................40
  155.                       msmotion..............................41
  156.                       msshowcur.............................41
  157.                       msspeed...............................41
  158.                       msstatus..............................42
  159.                       mssupport.............................42
  160.                       msvbounds.............................43
  161.                       numflop...............................43
  162.                       numoff................................44
  163.                       numon.................................44
  164.                       numpar................................44
  165.                       numser................................45
  166.                       printc................................45
  167.                       prints................................45
  168.                       putchat...............................46
  169.                       randfile..............................46
  170.                       readchat..............................47
  171.                       readcur...............................47
  172.                       revattr...............................48
  173.                       revsattr..............................48
  174.                       scancode..............................48
  175.                       scrndump..............................49
  176.                       scrntodisk............................49
  177.  
  178.  
  179.  
  180.                                       ii
  181.  
  182.  
  183.                       setattr...............................50
  184.                       setcursz..............................50
  185.                       setkbloop.............................50
  186.                       setlines..............................51
  187.                       setonkey..............................51
  188.                       showcur...............................52
  189.                       smcursor..............................52
  190.                       sound_................................53
  191.                       spc...................................53
  192.                       srestore..............................53
  193.                       ssave.................................54
  194.                       strblank..............................54
  195.                       strbmatch.............................55
  196.                       strchg................................55
  197.                       strchksum.............................56
  198.                       strcode...............................56
  199.                       strdel................................57
  200.                       strichg...............................57
  201.                       strichksum............................58
  202.                       stridel...............................58
  203.                       striinc...............................59
  204.                       strinc................................59
  205.                       strins................................60
  206.                       striocc...............................61
  207.                       strisocc..............................61
  208.                       strisrep..............................62
  209.                       strleft...............................62
  210.                       strljust..............................63
  211.                       strltrim..............................63
  212.                       strmatch..............................64
  213.                       strmid................................64
  214.                       strocc................................65
  215.                       strright..............................65
  216.                       strrjust..............................66
  217.                       strrol................................66
  218.                       strror................................67
  219.                       strsetsz..............................67
  220.                       strshl................................68
  221.                       strshr................................69
  222.                       strsocc...............................69
  223.                       strsrep...............................70
  224.                       strtrim...............................70
  225.                       struplow..............................71
  226.                       sysdate...............................71
  227.                       systime...............................72
  228.                       tabstop...............................72
  229.                       timer.................................73
  230.                       touplow...............................73
  231.                       videoinit.............................74
  232.                       vidtype...............................74
  233.                       wactiv................................75
  234.                       waitkey...............................75
  235.                       waitkeyt..............................76
  236.                       wborder...............................76
  237.  
  238.  
  239.  
  240.                                      iii
  241.  
  242.  
  243.                       wbox..................................77
  244.                       wcclear...............................77
  245.                       wcenters..............................78
  246.                       wchgattr..............................78
  247.                       wchkbox...............................79
  248.                       wchkcol...............................79
  249.                       wchkcoord.............................80
  250.                       wchkrow...............................80
  251.                       wclear................................81
  252.                       wclose................................81
  253.                       wcloseall.............................81
  254.                       wclreol...............................82
  255.                       wclreos...............................82
  256.                       wcopy.................................82
  257.                       wdelline..............................83
  258.                       wdump.................................84
  259.                       wdupc.................................84
  260.                       wdups.................................85
  261.                       werrmsg...............................85
  262.                       wfill.................................86
  263.                       wfillch...............................86
  264.                       wfindrec..............................87
  265.                       wgetc.................................87
  266.                       wgetchf...............................87
  267.                       wgetns................................88
  268.                       wgets.................................89
  269.                       wgotoxy...............................89
  270.                       whandle...............................90
  271.                       Context-Sensitive Help Functions......90
  272.                       whelpcat..............................92
  273.                       whelpclr..............................92
  274.                       whelpdef..............................93
  275.                       whelpop...............................93
  276.                       whelpopc..............................94
  277.                       whelpush..............................94
  278.                       whelpushc.............................94
  279.                       whide.................................95
  280.                       whline................................95
  281.                       windowat..............................96
  282.                       windump...............................96
  283.                       Multi-Field Input Functions...........97
  284.                       winpbeg...............................99
  285.                       winpdef..............................100
  286.                       winpfba..............................100
  287.                       winpfcurr............................101
  288.                       winpffind............................102
  289.                       winpread.............................102
  290.                       winputsf.............................103
  291.                       winsline.............................103
  292.                       wintodisk............................104
  293.                       wisactiv.............................104
  294.                       Bar Menu Functions...................105
  295.                       wmenubeg.............................106
  296.                       wmenubegc............................107
  297.  
  298.  
  299.  
  300.                                       iv
  301.  
  302.  
  303.                       wmenuend.............................108
  304.                       wmenuget.............................109
  305.                       wmenuiba.............................109
  306.                       wmenuicurr...........................110
  307.                       wmenuifind...........................111
  308.                       wmenuitem............................111
  309.                       wmenuitxt............................112
  310.                       wmenumcurr...........................113
  311.                       wmessage.............................113
  312.                       wmove................................114
  313.                       wopen................................114
  314.                       wperror..............................115
  315.                       wpgotoxy.............................116
  316.                       wpickfile............................116
  317.                       wpickstr.............................117
  318.                       wprintc..............................118
  319.                       wprintf..............................119
  320.                       wprints..............................119
  321.                       wprintsf.............................120
  322.                       wputc................................121
  323.                       wputns...............................121
  324.                       wputs................................122
  325.                       wputsw...............................122
  326.                       wreadcur.............................123
  327.                       wrestore.............................123
  328.                       wrjusts..............................124
  329.                       wsave................................124
  330.                       wscanf...............................125
  331.                       wscroll..............................125
  332.                       wscrollbox...........................126
  333.                       wselstr..............................126
  334.                       wsetesc..............................127
  335.                       wshadoff.............................127
  336.                       wshadow..............................128
  337.                       wsize................................128
  338.                       wtabwidth............................129
  339.                       wtextattr............................129
  340.                       wtitle...............................130
  341.                       wunhide..............................130
  342.                       wvline...............................131
  343.                       wwprints.............................132
  344.                  Appendix A - Text Attribute Identifiers...133
  345.                  Appendix B - Keycode Table................134
  346.                  Appendix C - Window Output Escape Codes...136
  347.                  Appendix D - Format Control Characters....137
  348.                  Appendix E - Input Field Editing Keys.....140
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.                                       v
  361.  
  362.  
  363.  
  364.                                 Introduction
  365.  
  366.  
  367.     General Information.
  368.  
  369.     The CXL library is intended to be a supplement to your C compiler's
  370.     standard run-time library.  It contains over 230 multi-purpose functions
  371.     which provide a variety of capabilities.  It is available for several
  372.     popular C compilers including Microsoft C, QuickC, Turbo C, Power C, and
  373.     Zortech C/C++.  These routines were written in 100% highly-optimized C
  374.     code ensuring maximum program speed, minimum program size, easy
  375.     modification, and increased portability.  This release is an evaluation
  376.     release containing everything you need to write C programs using the
  377.     small memory model. The libraries for the other memory models are
  378.     supplied when you register.
  379.  
  380.  
  381.     Features of the CXL Library.
  382.  
  383.         o   Powerful windowing system.  Allows as many open windows as
  384.             memory permits.  Windows can be stacked, tiled, shadowed, moved,
  385.             resized, and changed in many other ways.  There is a whole
  386.             assortment of various input and output functions to interract
  387.             with windows.
  388.  
  389.         o   Multi-field formatted data entry.  You can create data entry
  390.             forms that consist of one or more input fields.  You have full
  391.             control over user input and can tie validation functions into
  392.             each input field.  Features alpha and numeric justification,
  393.             capitalization conversion, formatting characters, and a large
  394.             assortment of editing keys.
  395.  
  396.         o   Moving bar menus.  You can easily create pop-up, pull-down, and
  397.             Lotus-style menus, as well as any other custom menu that you can
  398.             define.  Features full mouse support, nonselectable items,
  399.             global hot keys, and more.
  400.  
  401.         o   Scrollable pick menus.  Allow you to pick one item from a list
  402.             of items.  Features full mouse support and scroll bars.  There
  403.             is also a dedicated file picker that uses this feature to let
  404.             you pick from a list of files, very similar to the way that the
  405.             Turbo C and QuickC environments' file pickers work.
  406.  
  407.         o   Context-sensitive help system.  Help files are indexed for
  408.             speed.  Help categories can be cross-referenced.  Help can be
  409.             applied at the global, window, menu item, and input field
  410.             levels.
  411.  
  412.         o   Several video output methods.  These include direct screen
  413.             writing, direct screen writing with CGA snow reduction, video
  414.             BIOS writing, and DESQview video buffer writing.  These will
  415.             allow you to be video compatible with virtually any video
  416.             adapter or multitasking environment.
  417.  
  418.  
  419.  
  420.                                       1
  421.  
  422.  
  423.         o   EGA 43 and VGA 50-line modes.  CXL provides functions to
  424.             directly change to and from these modes.  CXL's video functions
  425.             are also compatible with nonstandard modes such as 132x80 and
  426.             120x43.
  427.  
  428.         o   Extensive mouse support.  Mouse movements can be translated into
  429.             keypresses, and several CXL functions have a "point-and-shoot"
  430.             type of mouse support that utilizes a free-moving mouse cursor.
  431.             There are also several functions for directly manipulating
  432.             Microsoft-compatible mice.
  433.  
  434.         o   Keyboard management routines.  Allows you to tie keystrokes to
  435.             functions, stuff and clear the keyboard buffer, set and read the
  436.             keyboard shift/toggle keys, and specify a function to be called
  437.             while waiting for a keypress.
  438.  
  439.         o   Advanced string manipulation.  There are a host of string
  440.             manipulation functions that perform searching, replacing,
  441.             formatting, conversion, rotating, shifting, pattern matching,
  442.             encryption, and other string operations.
  443.  
  444.         o   Several other functions for expanded memory (EMS) usage, file
  445.             encryption, date and time formatting, equipment detection,
  446.             printing, sound, and more.
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.                                       2
  481.  
  482.  
  483.     Registration Information.
  484.  
  485.     CXL is distributed as User-Supported software.  You are free to copy and
  486.     distribute this software freely, however, if you find it of use to you,
  487.     you are encouraged to register your copy.  Registering your copy of the
  488.     software helps the author continue to provide professional-quality
  489.     software at very reasonable prices.
  490.  
  491.     The Basic Registration is $35.00 and includes the full library source
  492.     code, one library disk of your choice, batch files to build and update
  493.     the libraries, royalty-free use of library functions, unlimited
  494.     technical support, and low-cost upgrades.  Library disks are available
  495.     for Microsoft C/QuickC, Turbo C, Zortech C/C++, and Power C.
  496.  
  497.     Since you will have the source code, you will be able to use it to build
  498.     any of the libraries for the supported compilers.  However, if you don't
  499.     want to hassle with building libraries, pre-compiled library disks are
  500.     available for an additional $5.00 each (one library disk is included in
  501.     the Basic Registration).
  502.  
  503.     All materials are shipped on 5.25-inch floppy diskettes, however, there
  504.     is a 3.5-inch floppy diskette service available for an additional $5.00.
  505.     This is a once-per-order charge that covers as many 3.5-inch floppy
  506.     disks as are needed to ship your order.
  507.  
  508.     Non-U.S. orders need to include $5.00 extra to cover additional shipping
  509.     and handling charges.  Checks and money orders must be drawn on a U.S.
  510.     bank.  Please send all payments payable in U.S. Dollars.
  511.  
  512.     Print the registration form, REGISTER.DOC, or include on a piece of
  513.     paper your name, address, phone number, and brand of compiler, and send
  514.     it along with your payment to:
  515.  
  516.             Mike Smedley
  517.             P.O. Box 33603
  518.             San Antonio, TX 78265-3603
  519.  
  520.     If by chance, you don't have the REGISTER.DOC file, a copy of the
  521.     registration form is included on the next page.
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.                                       3
  541.  
  542.  
  543.                              CXL REGISTRATION FORM
  544.  
  545.  
  546.         NAME:     ______________________________________________________
  547.  
  548.         COMPANY:  ______________________________________________________
  549.  
  550.         ADDRESS:  ______________________________________________________
  551.  
  552.                   ______________________________________________________
  553.  
  554.         CITY:     ______________________________________________________
  555.  
  556.         STATE:    ________________________  ZIP CODE:  _________________
  557.  
  558.         PHONE:    ______________________________________________________
  559.  
  560.         E-MAIL ADDRESS:  _______________________________________________
  561.  
  562.         WHERE DID YOU RECEIVE CXL?  ____________________________________
  563.  
  564.         ________________________________________________________________
  565.  
  566.         COMMENTS:  _____________________________________________________
  567.  
  568.         ________________________________________________________________
  569.  
  570.         ________________________________________________________________
  571.  
  572.         Basic Registration @ $35.00                          $__________
  573.             (Circle ONE library disk)
  574.  
  575.             Microsoft     Turbo      Zortech      Power
  576.  
  577.         Additional Library Disks @ $5.00 each                 __________
  578.             (Circle each ADDITIONAL library disk)
  579.  
  580.             Microsoft     Turbo      Zortech      Power
  581.  
  582.         3.5-Inch Floppy Disk Service @ $5.00                  __________
  583.  
  584.         Non-US Shipping @ $5.00                               __________
  585.             (Payments must be in US Dollars, US bank)
  586.  
  587.         5.0                                         TOTAL:   $__________
  588.  
  589.         Remit to:         Mike Smedley
  590.                           P.O. Box 33603
  591.                           San Antonio, TX 78265-3603
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.                                       4
  601.  
  602.  
  603.     How to Contact the Author.
  604.  
  605.     Primary:
  606.         Official CXL Support BBS - (512) 590-0460  1200/2400
  607.  
  608.     Alternate:
  609.         CompuServe   -  71331,2244
  610.         GEnie        -  M.SMEDLEY
  611.         Telstar BBS  -  (512) 822-8882  1200/2400
  612.         U.S. Mail    -  see address above
  613.  
  614.  
  615.     Disclaimer.
  616.  
  617.     The author claims no responsibility for any damages caused by the use or
  618.     misuse of this product.  This product is distributed "as is" with no
  619.     warranty expressed or implied.  The author will not be responsible for
  620.     any losses incurred, either directly or indirectly, by the use of this
  621.     product. The author reserves the right to make modifications at any
  622.     time.  Prices are subject to change without notice.
  623.  
  624.  
  625.     Trademarks.
  626.  
  627.     CompuServe is a registered trademark of CompuServe Incorporated.
  628.     DESQview is a trademark of Quarterdeck Office Systems.
  629.     Epson is a registered trademark of Seiko Epson Corporation.
  630.     GEnie is a trademark of GE Information Services.
  631.     IBM is a registered trademark of International Business Machines.
  632.     LIM and EMS are trademarks of Lotus, Intel, and Microsoft Corporations.
  633.     Lotus is a registered trademark of Lotus Development Corporation.
  634.     Microsoft is a registered trademark of Microsoft Corporation.
  635.     Power C is a trademark of Mix Software, Inc.
  636.     Turbo C is a registered trademark of Borland International.
  637.     Zortech is a trademark of Zortech Inc.
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.                                       5
  661.  
  662.  
  663.     Using CXL Functions.
  664.  
  665.     For every CXL function you use, there should be a corresponding CXL
  666.     header file #included at the top of your program.  The CXL header files
  667.     should follow your standard compiler header files.  For example:
  668.  
  669.         #include    <dos.h>
  670.         #include    <stdio.h>
  671.         #include    "cxldef.h"
  672.         #include    "cxlwin.h"
  673.  
  674.     The basic command line compiler/linker commands to build your file
  675.     containing CXL functions are as follows:
  676.  
  677.         Microsoft C:
  678.  
  679.             cl myfile.c cxlmss.lib
  680.  
  681.         Quick C:
  682.  
  683.             qcl myfile.c cxlmss.lib
  684.  
  685.         Power C:
  686.  
  687.             pc -c -d__POWERC__ myfile.c
  688.             pcl myfile.mix ;cxlpcm.mix
  689.  
  690.         Turbo C:
  691.  
  692.             tcc myfile.c cxltcs.lib
  693.  
  694.         Zortech C/C++:
  695.  
  696.             ztc myfile.c cxlzts.lib           /* for C programs */
  697.  
  698.             ztc myfile.cpp cxlzts.lib         // for C++ programs
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.                                       6
  721.  
  722.  
  723.                                Global Variables
  724.  
  725.  
  726.     NAME
  727.         _kbinfo
  728.  
  729.     DESCRIPTION
  730.         A record which holds keyboard information.  The individual structure
  731.         elements are:
  732.             kbuf   - pointer to head record in key buffer.
  733.             onkey  - pointer to head record in onkey list.
  734.             kbloop - pointer to function to call while waiting for a
  735.                      keypress.  This variable should be set with the
  736.                      setkbloop() function.
  737.             inmenu - inmenu flag used internally by the menuing and picking
  738.                      functions to help control mouse support.
  739.  
  740.     SYNOPSIS
  741.         #include "cxlkey.h"
  742.         struct _kbinfo_t _kbinfo;
  743.  
  744.     ------------------------------------------------------------------------
  745.  
  746.     NAME
  747.         _mouse
  748.  
  749.     DESCRIPTION
  750.         This variable is set by the msinit() and/or mssupport() function. It
  751.         contains MS_NONE by default.  If msinit() detects a mouse, it will
  752.         set _mouse to MS_KEYS.  Also see the function descriptions of
  753.         msinit() and mssupport().
  754.  
  755.     SYNOPSIS
  756.         #include "cxlmou.h"
  757.         int _mouse;
  758.  
  759.     ------------------------------------------------------------------------
  760.  
  761.     NAME
  762.         _vinfo
  763.  
  764.     DESCRIPTION
  765.         The video information record.  The videoinit() function is
  766.         responsible for setting most of the elements in this record. If you
  767.         don't call videoinit(), they will default to CGA settings.  If you
  768.         modify any of these, you must modify them AFTER the call to
  769.         videoinit().  The one exception is _vinfo.dvcheck which, if used,
  770.         must be set BEFORE the call to videoinit().  The individual
  771.         structure elements are:
  772.             videoseg - video buffer segment address.  Default is 0xb800.
  773.             adapter  - video adapter type.  Default is V_CGA.
  774.             numrows  - number of displayed rows.  Default is 25.
  775.             numcols  - number of displayed columns.  Default is 80.
  776.             cheight  - character height in pixels.  Default is 8.
  777.  
  778.  
  779.  
  780.                                       7
  781.  
  782.  
  783.             cwidth   - character width  in pixels. Default is 8.
  784.             mono     - is it a monochrome video adapter?  Default is 0.
  785.             mapattr  - map color attribs to monochrome attribs?  By default,
  786.                        if a monochrome video adapter is detected by
  787.                        videoinit(), then all color attributes will be mapped
  788.                        to monochrome equivalents.  To disable this automatic
  789.                        mapping, set _vinfo.mapattr=0;.  Default is 1.
  790.             cgasnow  - is CGA snow present?  To turn snow reduction on, set
  791.                        _vinfo.cgasnow=1;.  Default is 0.
  792.             retminch - minimum number of characters required to wait for
  793.                        vertical retrace.  If you write a string whose length
  794.                        is less than this value, CXL will use BIOS instead of
  795.                        waiting for vertical retrace.  This is only used when
  796.                        _vinfo.cgasnow==1.  Default is 10.
  797.             usebios  - use BIOS for video writes?  To use BIOS for video
  798.                        writes, set _vinfo.usebios=1;.
  799.             dvcheck  - check for DESQview?  To disable videoinit() from
  800.                        checking for DESQview, set _vinfo.dvcheck=0; before
  801.                        calling videoinit().  Default is 1.
  802.             dvexist  - is DESQview present?  Default is 0.
  803.  
  804.     SYNOPSIS
  805.         #include "cxlvid.h"
  806.         struct _vinfo_t _vinfo;
  807.  
  808.     ------------------------------------------------------------------------
  809.  
  810.     NAME
  811.         _winfo
  812.  
  813.     DESCRIPTION
  814.         The window information record.  The individual structure elements
  815.         are:
  816.             active   - pointer to active window's record.
  817.             hidden   - pointer to head hidden window's record.
  818.             menu     - pointer to head menu's record.
  819.             cmenu    - pointer to current menu's record.
  820.             help     - current help category number.
  821.             handle   - last handle given to a window.  Every time wopen()
  822.                        creates a new window, it increments this value.
  823.             errno    - error number from last windowing function.  Most
  824.                        windowing functions set this variable before
  825.                        returning.  The werrmsg() function returns a literal
  826.                        representation of this value.
  827.             total    - total number of open windows.
  828.             mlevel   - system variable used by menu functions.
  829.             ilevel   - system variable used by menu functions.
  830.             esc      - check for [Esc] in input funcions? You should use the
  831.                        wsetesc() function to set this value.  Default is 1
  832.                        (yes).
  833.             tabwidth - window TTY output tab width.  You can use wtabwidth()
  834.                        to set this value.  Default is 8.
  835.             fillch   - character to fill windows with.  You should use
  836.                        wfillch() to set this value.  Default is ' '.
  837.  
  838.  
  839.  
  840.                                       8
  841.  
  842.  
  843.     SYNOPSIS
  844.         #include "cxlwin.h"
  845.         struct _winfo_t _winfo;
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.                                       9
  901.  
  902.  
  903.                               Library Functions
  904.  
  905.  
  906.     NAME
  907.         attrib
  908.  
  909.     DESCRIPTION
  910.         Creates a text attribute.  It is usually much easier to create a
  911.         text attribute using the attribute identifiers listed in Appendix A,
  912.         but this provides an alternate method.
  913.  
  914.     SYNOPSIS
  915.         #include "cxlvid.h"
  916.         int attrib(int fore,int back,int bright,int blink);
  917.  
  918.     INPUTS
  919.         fore   - foreground color code (0-7)
  920.         back   - background color code (0-7)
  921.         bright - intensity (0-1)
  922.         blink  - blinking (0-1)
  923.  
  924.     RETURN VALUE
  925.         The new attribute code.
  926.  
  927.     ALSO SEE
  928.         setattr  wtextattr
  929.  
  930.     EXAMPLE
  931.         prints(10,5,attrib(6,0,1,1),"Hello, world");
  932.  
  933.     ------------------------------------------------------------------------
  934.  
  935.     NAME
  936.         beep
  937.  
  938.     DESCRIPTION
  939.         Sounds a beep in the speaker.
  940.  
  941.     SYNOPSIS
  942.         #include "cxldef.h"
  943.         void beep(void);
  944.  
  945.     ALSO SEE
  946.         sound_
  947.  
  948.     ------------------------------------------------------------------------
  949.  
  950.     NAME
  951.         biosver
  952.  
  953.     DESCRIPTION
  954.         Returns the ROM BIOS version date.
  955.  
  956.     SYNOPSIS
  957.  
  958.  
  959.  
  960.                                       10
  961.  
  962.  
  963.         #include "cxldef.h"
  964.         char *biosver(void);
  965.  
  966.     RETURN VALUE
  967.         The address of the static string containing the ROM BIOS version
  968.         date.
  969.  
  970.     ALSO SEE
  971.         machid
  972.  
  973.     ------------------------------------------------------------------------
  974.  
  975.     NAME
  976.         box_
  977.  
  978.     DESCRIPTION
  979.         "Draws" a text box on the screen.
  980.  
  981.     SYNOPSIS
  982.         #include "cxlvid.h"
  983.         void box_(int srow,int scol,int erow,int ecol,int btype,int attr);
  984.  
  985.     INPUTS
  986.         srow  - start row of box
  987.         scol  - start column of box
  988.         erow  - end row of box
  989.         ecol  - end column of box
  990.         btype - box type.  Can be one of the following:
  991.                     0 - single line
  992.                     1 - double line
  993.                     2 - single horz, double vert line
  994.                     3 - double horz, single vert line
  995.                     4 - thick line
  996.                     5 - no border (uses spaces for box chars)
  997.         attr  - text attribute for border characters
  998.  
  999.     ALSO SEE
  1000.         fill_
  1001.  
  1002.     EXAMPLE
  1003.         box_(10,10,20,40,2,YELLOW|_BLACK);
  1004.  
  1005.     ------------------------------------------------------------------------
  1006.  
  1007.     NAME
  1008.         capsoff
  1009.  
  1010.     DESCRIPTION
  1011.         Toggles the CapsLock key off.
  1012.  
  1013.     SYNOPSIS
  1014.         #include "cxlkey.h"
  1015.         void capsoff(void);
  1016.  
  1017.  
  1018.  
  1019.  
  1020.                                       11
  1021.  
  1022.  
  1023.     ALSO SEE
  1024.         capson  kbstat  numoff  numon
  1025.  
  1026.     ------------------------------------------------------------------------
  1027.  
  1028.     NAME
  1029.         capson
  1030.  
  1031.     DESCRIPTION
  1032.         Toggles the CapsLock key on.
  1033.  
  1034.     SYNOPSIS
  1035.         #include "cxlkey.h"
  1036.         void capson(void);
  1037.  
  1038.     ALSO SEE
  1039.         capsoff  kbstat  numoff  numon
  1040.  
  1041.     ------------------------------------------------------------------------
  1042.  
  1043.     NAME
  1044.         cclrscrn
  1045.  
  1046.     DESCRIPTION
  1047.         Clears the screen using given text attribute and homes the cursor.
  1048.  
  1049.     SYNOPSIS
  1050.         #include "cxlvid.h"
  1051.         void cclrscrn(int attr);
  1052.  
  1053.     INPUTS
  1054.         attr - text attribute to use to clear the screen with
  1055.  
  1056.     ALSO SEE
  1057.         clreol_  clrscrn  clrwin
  1058.  
  1059.     EXAMPLE
  1060.         cclrscrn(BLACK|_BLACK);
  1061.  
  1062.     ------------------------------------------------------------------------
  1063.  
  1064.     NAME
  1065.         clearkeys
  1066.  
  1067.     DESCRIPTION
  1068.         Clears the keyboard buffer.
  1069.  
  1070.     SYNOPSIS
  1071.         #include <conio.h>
  1072.         #include "cxlkey.h"
  1073.         void clearkeys(void);
  1074.  
  1075.     ALSO SEE
  1076.         kbclear  waitkey
  1077.  
  1078.  
  1079.  
  1080.                                       12
  1081.  
  1082.  
  1083.     ------------------------------------------------------------------------
  1084.  
  1085.     NAME
  1086.         clockcal
  1087.  
  1088.     DESCRIPTION
  1089.         Determines if a clock-calendar board is installed.  This usually
  1090.         will only work with the clock-calendar boards in XT-style machines.
  1091.  
  1092.     SYNOPSIS
  1093.         #include "cxldef.h"
  1094.         int clockcal(void);
  1095.  
  1096.     RETURN VALUE
  1097.         Nonzero if a clock-calendar board is present.
  1098.  
  1099.     ------------------------------------------------------------------------
  1100.  
  1101.     NAME
  1102.         clreol_
  1103.  
  1104.     DESCRIPTION
  1105.         Clears to the end of line using the text attribute under the cursor.
  1106.  
  1107.     SYNOPSIS
  1108.         #include "cxlvid.h"
  1109.         void clreol_(void);
  1110.  
  1111.     ALSO SEE
  1112.         cclrscrn  clrscrn  clrwin
  1113.  
  1114.     ------------------------------------------------------------------------
  1115.  
  1116.     NAME
  1117.         clrscrn
  1118.  
  1119.     DESCRIPTION
  1120.         Clears the screen using the text attribute under the cursor, and
  1121.         homes the cursor.
  1122.  
  1123.     SYNOPSIS
  1124.         #include "cxlvid.h"
  1125.         void clrscrn(void);
  1126.  
  1127.     ALSO SEE
  1128.         cclrscrn  clreol_  clrwin
  1129.  
  1130.     ------------------------------------------------------------------------
  1131.  
  1132.     NAME
  1133.         clrwin
  1134.  
  1135.     DESCRIPTION
  1136.         Clears a window of the screen using the text attribute under the
  1137.  
  1138.  
  1139.  
  1140.                                       13
  1141.  
  1142.  
  1143.         cursor.
  1144.  
  1145.     SYNOPSIS
  1146.         #include "cxlvid.h"
  1147.         void clrwin(int srow,int scol,int erow,int ecol);
  1148.  
  1149.     INPUTS
  1150.         srow - start row of window
  1151.         scol - start column of window
  1152.         erow - end row of window
  1153.         ecol - end column of window
  1154.  
  1155.     ALSO SEE
  1156.         cclrscrn  clreol_  clrscrn
  1157.  
  1158.     ------------------------------------------------------------------------
  1159.  
  1160.     NAME
  1161.         cvaltype
  1162.  
  1163.     DESCRIPTION
  1164.         Checks given character against a given CXL character type code, and
  1165.         determines if that character is valid for that type.  This function
  1166.         is used internally by several CXL functions.
  1167.  
  1168.     SYNOPSIS
  1169.         #include "cxlstr.h"
  1170.         int cvaltype(int ch,int ctype);
  1171.  
  1172.     INPUTS
  1173.         ch    - character to test
  1174.         ctype - character type code to compare with.  See section on CXL
  1175.                 format strings for a list of valid character type codes.
  1176.                 See Appendix D for a list of character type codes which can
  1177.                 be used.
  1178.  
  1179.     RETURN VALUE
  1180.         -1 - invalid ctype was given
  1181.         0  - character is not valid for given ctype
  1182.         1  - character is valid for given ctype
  1183.  
  1184.     EXAMPLE
  1185.         printf("'A' is %sa valid character of type '#'\n",cvaltype('A','#')?
  1186.                "":"not ");
  1187.         printf("'7' is %sa valid character of type '#'\n",cvaltype('7','#')?
  1188.                "":"not ");
  1189.  
  1190.     ------------------------------------------------------------------------
  1191.  
  1192.     NAME
  1193.         cvtcf
  1194.  
  1195.     DESCRIPTION
  1196.         Converts a CXL field string to a floating point number.
  1197.  
  1198.  
  1199.  
  1200.                                       14
  1201.  
  1202.  
  1203.     SYNOPSIS
  1204.         #include "cxlstr.h"
  1205.         double cvtcf(char *field,int wholesize,int fracsize);
  1206.  
  1207.     INPUTS
  1208.         field     - address of CXL field string
  1209.         wholesize - number of whole digits
  1210.         fracsize  - number of fractional digits
  1211.  
  1212.     RETURN VALUE
  1213.         A double precision floating point number.
  1214.  
  1215.     ALSO SEE
  1216.         cvtci  cvtfc  cvtic
  1217.  
  1218.     EXAMPLE
  1219.         double pi;
  1220.         pi=cvtcf("314159",1,5);
  1221.         printf("pi = %f\n",pi);
  1222.  
  1223.     ------------------------------------------------------------------------
  1224.  
  1225.     NAME
  1226.         cvtci
  1227.  
  1228.     DESCRIPTION
  1229.         Converts a CXL field string to an integer.
  1230.  
  1231.     SYNOPSIS
  1232.         #include "cxlstr.h"
  1233.         int cvtci(char *field);
  1234.  
  1235.     INPUTS
  1236.         field - address of CXL field string
  1237.  
  1238.     RETURN VALUE
  1239.         An integer number.
  1240.  
  1241.     ALSO SEE
  1242.         cvtcf  cvtfc  cvtic
  1243.  
  1244.     EXAMPLE
  1245.         int i;
  1246.         i=cvtci("32767");
  1247.         printf("i = %d\n",i);
  1248.  
  1249.     ------------------------------------------------------------------------
  1250.  
  1251.     NAME
  1252.         cvtfc
  1253.  
  1254.     DESCRIPTION
  1255.         Converts a floating point number to a CXL field string.
  1256.  
  1257.  
  1258.  
  1259.  
  1260.                                       15
  1261.  
  1262.  
  1263.     SYNOPSIS
  1264.         #include "cxlstr.h"
  1265.         void cvtfc(char *field,double value,int wholesize,int fracsize);
  1266.  
  1267.     INPUTS
  1268.         field     - address of buffer to receive field string
  1269.         value     - floating point number to convert
  1270.         wholesize - number of whole digits
  1271.         fracsize  - number of fractional digits
  1272.  
  1273.     ALSO SEE
  1274.         cvtcf  cvtci  cvtic
  1275.  
  1276.     EXAMPLE
  1277.         char field[8];
  1278.         cvtfc(field,3.14159,2,4);
  1279.         printf("field = '%s'\n",field);
  1280.  
  1281.     ------------------------------------------------------------------------
  1282.  
  1283.     NAME
  1284.         cvtic
  1285.  
  1286.     DESCRIPTION
  1287.         Converts an integer to a CXL field string.
  1288.  
  1289.     SYNOPSIS
  1290.         #include "cxlstr.h"
  1291.         void cvtic(char *field,int value,int size);
  1292.  
  1293.     INPUTS
  1294.         field - address of buffer to receive CXL field string
  1295.         value - integer value to convert
  1296.         size  - field size
  1297.  
  1298.     ALSO SEE
  1299.         cvtcf  cvtci  cvtfc
  1300.  
  1301.     EXAMPLE
  1302.         char field[8];
  1303.         cvtic(field,27,5);
  1304.         printf("field = '%s'\n",field);
  1305.  
  1306.     ------------------------------------------------------------------------
  1307.  
  1308.     NAME
  1309.         cxlver
  1310.  
  1311.     DESCRIPTION
  1312.         Returns the CXL version number of the current CXL library in use.
  1313.  
  1314.     SYNOPSIS
  1315.         #include "cxldef.h"
  1316.         char *cxlver(void);
  1317.  
  1318.  
  1319.  
  1320.                                       16
  1321.  
  1322.  
  1323.     RETURN VALUE
  1324.         The address of the static string containing the CXL version number.
  1325.  
  1326.     ------------------------------------------------------------------------
  1327.  
  1328.     NAME
  1329.         delay_
  1330.  
  1331.     DESCRIPTION
  1332.         Delays program execution for a specified duration.
  1333.  
  1334.     SYNOPSIS
  1335.         #include "cxldef.h"
  1336.         void delay_(unsigned duration);
  1337.  
  1338.     INPUTS
  1339.         duration - duration of delay (0-65535) ie. 182 = 10 seconds
  1340.  
  1341.     ALSO SEE
  1342.         timer  waitkeyt
  1343.  
  1344.     EXAMPLE
  1345.         delay_(36);     /* pause for 2 seconds */
  1346.  
  1347.     ------------------------------------------------------------------------
  1348.  
  1349.     NAME
  1350.         disktoscrn
  1351.  
  1352.     DESCRIPTION
  1353.         Copies a previously saved screen disk file to the screen.
  1354.  
  1355.     SYNOPSIS
  1356.         #include "cxlvid.h"
  1357.         int disktoscrn(char *fname);
  1358.  
  1359.     INPUTS
  1360.         fname - address of the string containing file name to read from.
  1361.  
  1362.     RETURN VALUE
  1363.         Nonzero if an error occurred.
  1364.  
  1365.     ALSO SEE
  1366.         disktowin  scrntodisk  wintodisk
  1367.  
  1368.     EXAMPLE
  1369.         char fname[]="SCRN.DAT";
  1370.         if(disktoscrn(fname)) {
  1371.             printf("Error reading file:  %s\n",fname);
  1372.             exit(1);
  1373.         }
  1374.  
  1375.     ------------------------------------------------------------------------
  1376.  
  1377.  
  1378.  
  1379.  
  1380.                                       17
  1381.  
  1382.  
  1383.     NAME
  1384.         disktowin
  1385.  
  1386.     DESCRIPTION
  1387.         Copies a previously saved window disk file to the screen.
  1388.  
  1389.     SYNOPSIS
  1390.         #include "cxlvid.h"
  1391.         int disktowin(char *fname);
  1392.  
  1393.     INPUTS
  1394.         fname - address of the string containing file name of file to read
  1395.                 from.
  1396.  
  1397.     RETURN VALUE
  1398.         Nonzero if an error occurred.
  1399.  
  1400.     ALSO SEE
  1401.         disktoscrn  scrntodisk  wintodisk
  1402.  
  1403.     EXAMPLE
  1404.         char fname[]="WIND.DAT";
  1405.         if(disktowin(fname)) {
  1406.             printf("Error reading file:  %s\n",fname);
  1407.             exit(1);
  1408.         }
  1409.  
  1410.     ------------------------------------------------------------------------
  1411.  
  1412.     EMS Functions
  1413.  
  1414.     CXL contains several functions for simple management of expanded
  1415.     memory. All of CXL's EMS functions are prefixed with 'ems'.  For those
  1416.     not familiar with expanded memory, I will briefly explain it.
  1417.  
  1418.     The 8088 microprocessor is only able to address 1 Megabyte of memory.
  1419.     When applications started needing more memory, Lotus, Intel, and
  1420.     Microsoft developed the Expanded Memory Specification.  This
  1421.     specification allows access to more than 1 Megabyte of memory by mapping
  1422.     16K 'windows' of memory on an expanded memory board in and out of an
  1423.     unused area of DOS memory.  The Expanded Memory Manager (EMM) is a
  1424.     software driver that controls the mapping.
  1425.  
  1426.     Physical pages are 16K blocks of memory which are located in an unused
  1427.     area of DOS memory.  There are typically 4 physical pages comprising a
  1428.     64K contiguous area of mappable DOS memory.  The EMS page frame base
  1429.     address points to the beginning of the first physical page.  Logical
  1430.     pages are 16K blocks of memory on the expanded memory board.  There can
  1431.     be as many logical pages as the expanded memory board has, up to 8
  1432.     Megabytes.
  1433.  
  1434.     Every program that uses expanded memory must do the following:
  1435.  
  1436.         1.  determine if the EMM device driver is loaded
  1437.  
  1438.  
  1439.  
  1440.                                       18
  1441.  
  1442.  
  1443.         2.  determine if there are enough free pages for its application
  1444.         3.  allocate pages of expanded memory
  1445.         4.  find out what the EMS page frame base address is
  1446.         5.  map logical pages onto physical pages
  1447.         6.  deallocate pages when finished with them
  1448.  
  1449.     Here's an example of using CXL's EMS functions to perform these
  1450.     procedures:
  1451.  
  1452.         int handle1,handle2;
  1453.         char buf[14];
  1454.         if(!emsexist()) {                /*  Check for the EMM driver.    */
  1455.             printf("EMM not loaded\n");
  1456.             exit(1);
  1457.         }
  1458.         handle1=emsalloc(2);             /*  Request 2 pages of EMS       */
  1459.                                          /*  memory.                      */
  1460.         handle2=emsalloc(2);             /*  Request 2 more pages.        */
  1461.         if(handle1==-1 || handle2==-1) { /*  Test for allocation error.   */
  1462.             printf("EMS allocation error\n");
  1463.             exit(1);
  1464.         }
  1465.         emsmap(handle1,0,0);             /*  Map logical page 0 of handle */
  1466.                                          /*  1 to physical page 0.        */
  1467.         emswrite("Hello, world",0,13);   /*  Write a string at offset 0,  */
  1468.                                          /*  automatically determines what*/
  1469.                                          /*  the page frame address is.   */
  1470.         emsmap(handle2,0,0);             /*  Map logical page 0 of handle */
  1471.                                          /*  2 to physical page 0.        */
  1472.         emswrite("How are you?",0,13);   /*  Write a string at offset 0.  */
  1473.         emsmap(handle1,0,0);             /*  Map logical page 0 of handle */
  1474.                                          /*  1 to physical page 0.        */
  1475.         emsread(buf,0,13);               /*  Read 13 bytes from offset 0  */
  1476.                                          /*  into buffer.                 */
  1477.         printf("buf = %s\n",buf);        /*  Display buffer contents.     */
  1478.         emsmap(handle2,0,0);             /*  Map logical page 0 of handle */
  1479.                                          /*  2 to physical page 0.        */
  1480.         emsread(buf,0,13);               /*  Read 13 bytes from offset 0  */
  1481.                                          /*  into buffer.                 */
  1482.         printf("buf = %s\n",buf);        /*  Display buffer contents.     */
  1483.         emsdealloc(handle2);             /*  Deallocate pages belonging   */
  1484.                                          /*  to handle 2.                 */
  1485.         emsdealloc(handle1);             /*  Deallocate pages belonging   */
  1486.                                          /*  to handle 1.                 */
  1487.  
  1488.     ------------------------------------------------------------------------
  1489.  
  1490.     NAME
  1491.         emsalloc
  1492.  
  1493.     DESCRIPTION
  1494.         Allocates pages of EMS memory.
  1495.  
  1496.     SYNOPSIS
  1497.  
  1498.  
  1499.  
  1500.                                       19
  1501.  
  1502.  
  1503.         #include "cxlems.h"
  1504.         int emsalloc(int numpages);
  1505.  
  1506.     INPUTS
  1507.         numpages - the number of pages (16K blocks) of memory requested.
  1508.                    For example, to allocate 512K of EMS memory, you would
  1509.                    request 512/16, or 32 pages.
  1510.  
  1511.     RETURN VALUE
  1512.         The EMS handle assigned to the allocated block of memory, or -1 if
  1513.         an error occurred.
  1514.  
  1515.     ALSO SEE
  1516.         emsdealloc  emsexist  emsfree
  1517.  
  1518.     ------------------------------------------------------------------------
  1519.  
  1520.     NAME
  1521.         emsdealloc
  1522.  
  1523.     DESCRIPTION
  1524.         Deallocates previously allocated pages of EMS memory.
  1525.  
  1526.     SYNOPSIS
  1527.         #include "cxlems.h"
  1528.         int emsdealloc(int handle);
  1529.  
  1530.     INPUTS
  1531.         handle - the EMS handle of the allocated EMS memory to deallocate
  1532.  
  1533.     RETURN VALUE
  1534.         Nonzero if an error occurred.
  1535.  
  1536.     ALSO SEE
  1537.         emsalloc  emsexist
  1538.  
  1539.     ------------------------------------------------------------------------
  1540.  
  1541.     NAME
  1542.         emsexist
  1543.  
  1544.     DESCRIPTION
  1545.         Determines if the EMS device driver is loaded.
  1546.  
  1547.     SYNOPSIS
  1548.         #include "cxlems.h"
  1549.         int emsexist(void);
  1550.  
  1551.     RETURN VALUE
  1552.         Nonzero if an EMS driver is loaded and functioning properly.
  1553.  
  1554.     ALSO SEE
  1555.         emsfree  emstotal  expmem
  1556.  
  1557.  
  1558.  
  1559.  
  1560.                                       20
  1561.  
  1562.  
  1563.     ------------------------------------------------------------------------
  1564.  
  1565.     NAME
  1566.         emsframe
  1567.  
  1568.     DESCRIPTION
  1569.         Returns the EMS page frame base segment address.
  1570.  
  1571.     SYNOPSIS
  1572.         #include "cxlems.h"
  1573.         unsigned emsframe(void);
  1574.  
  1575.     RETURN VALUE
  1576.         The EMS page frame base segment address, or zero if an error
  1577.         occurred.
  1578.  
  1579.     ALSO SEE
  1580.         emsalloc  emsexist  emsmap
  1581.  
  1582.     EXAMPLE
  1583.         char far *p;
  1584.         p=MK_FP(emsframe(),0);
  1585.         printf("EMS memory starts at %Fp\n",p);
  1586.  
  1587.     ------------------------------------------------------------------------
  1588.  
  1589.     NAME
  1590.         emsfree
  1591.  
  1592.     DESCRIPTION
  1593.         Returns the number of free EMS pages (16K blocks).
  1594.  
  1595.     SYNOPSIS
  1596.         #include "cxlems.h"
  1597.         unsigned emsfree(void);
  1598.  
  1599.     RETURN VALUE
  1600.         The number of free EMS pages.
  1601.  
  1602.     ALSO SEE
  1603.         emsalloc  emsdealloc  emstotal
  1604.  
  1605.     ------------------------------------------------------------------------
  1606.  
  1607.     NAME
  1608.         emsmap
  1609.  
  1610.     DESCRIPTION
  1611.         Maps a logical page of allocated EMS memory onto a physical page
  1612.         address.
  1613.  
  1614.     SYNOPSIS
  1615.         #include "cxlems.h"
  1616.         int emsmap(int handle,int lpage,int ppage);
  1617.  
  1618.  
  1619.  
  1620.                                       21
  1621.  
  1622.  
  1623.     INPUTS
  1624.         handle - the EMS handle previosly assigned
  1625.         lpage  - the logical EMS page to map (0 - ?)
  1626.         ppage  - the physical DOS page to map to (0 - 3)
  1627.  
  1628.     RETURN VALUE
  1629.         Nonzero if an error occurred.
  1630.  
  1631.     ALSO SEE
  1632.         emsalloc  emsdealloc  emsframe
  1633.  
  1634.     ------------------------------------------------------------------------
  1635.  
  1636.     NAME
  1637.         emsread
  1638.  
  1639.     DESCRIPTION
  1640.         Reads bytes from one or more pages of allocated EMS memory.  The
  1641.         emsmap() function must be called prior to this function to make this
  1642.         memory accessible.  The source segment used will be the current EMS
  1643.         page frame segment address and the destination segment will be your
  1644.         program's data segment.
  1645.  
  1646.     SYNOPSIS
  1647.         #include "cxlems.h"
  1648.         int emsread(char *dest,unsigned emsofs,unsigned numbytes);
  1649.  
  1650.     INPUTS
  1651.         dest     - address of buffer to receive bytes read from EMS
  1652.         emsofs   - offset from the EMS page frame base segment address to
  1653.                    read the bytes from.
  1654.         numbytes - the number of bytes to read
  1655.  
  1656.     RETURN VALUE
  1657.         Nonzero if an error occurred.
  1658.  
  1659.     ALSO SEE
  1660.         emsalloc  emsdealloc  emsmap  emswrite
  1661.  
  1662.     ------------------------------------------------------------------------
  1663.  
  1664.     NAME
  1665.         emstotal
  1666.  
  1667.     DESCRIPTION
  1668.         Returns the total number of EMS memory pages (16K blocks) on the
  1669.         system.
  1670.  
  1671.     SYNOPSIS
  1672.         #include "cxlems.h"
  1673.         unsigned emstotal(void);
  1674.  
  1675.     RETURN VALUE
  1676.         The total number of EMS memory pages on the system.
  1677.  
  1678.  
  1679.  
  1680.                                       22
  1681.  
  1682.  
  1683.     ALSO SEE
  1684.         emsalloc  emsdealloc  emsexist  emsfree  expmem
  1685.  
  1686.     ------------------------------------------------------------------------
  1687.  
  1688.     NAME
  1689.         emsver
  1690.  
  1691.     DESCRIPTION
  1692.         Returns the version of the EMS driver in use.
  1693.  
  1694.     SYNOPSIS
  1695.         #include "cxlems.h"
  1696.         char *emsver(void);
  1697.  
  1698.     RETURN VALUE
  1699.         The address of the static string containing the EMS version number,
  1700.         or NULL if an error occurred.
  1701.  
  1702.     ALSO SEE
  1703.         emsexist
  1704.  
  1705.     ------------------------------------------------------------------------
  1706.  
  1707.     NAME
  1708.         emswrite
  1709.  
  1710.     DESCRIPTION
  1711.         Writes bytes to one or more pages of EMS memory.  The emsmap()
  1712.         function must have been called prior to calling this function so
  1713.         that the EMS memory will be available.  The source segment will be
  1714.         your program's data segment and the destination segment will be the
  1715.         current EMS page frame segment address.
  1716.  
  1717.     SYNOPSIS
  1718.         #include "cxlems.h"
  1719.         int emswrite(char *src,unsigned emsofs,unsigned numbytes);
  1720.  
  1721.     INPUTS
  1722.         src      - address of buffer that contains the bytes to be written
  1723.         emsofs   - offset from EMS page frame base segment address to write
  1724.                    bytes to
  1725.         numbytes - number of bytes to write
  1726.  
  1727.     RETURN VALUE
  1728.         Nonzero if an error occurred.
  1729.  
  1730.     ALSO SEE
  1731.         emsexist  emsframe  emsmap  emsread
  1732.  
  1733.     ------------------------------------------------------------------------
  1734.  
  1735.     NAME
  1736.         expmem
  1737.  
  1738.  
  1739.  
  1740.                                       23
  1741.  
  1742.  
  1743.     DESCRIPTION
  1744.         Determines the amount, if any, of expanded memory on the system.  An
  1745.         EMS driver does not have to be loaded to call this function.
  1746.  
  1747.     SYNOPSIS
  1748.         #include "cxldef.h"
  1749.         unsigned expmem(void);
  1750.  
  1751.     RETURN VALUE
  1752.         The amount of expanded memory in kilobytes.
  1753.  
  1754.     ALSO SEE
  1755.         emsexist  extmem
  1756.  
  1757.     ------------------------------------------------------------------------
  1758.  
  1759.     NAME
  1760.         extmem
  1761.  
  1762.     DESCRIPTION
  1763.         Determines the amount of extended memory on an AT-class machine.
  1764.  
  1765.     SYNOPSIS
  1766.         #include "cxldef.h"
  1767.         unsigned extmem(void);
  1768.  
  1769.     RETURN VALUE
  1770.         The amount of extended memory in kilobytes.
  1771.  
  1772.     ALSO SEE
  1773.         expmem
  1774.  
  1775.     ------------------------------------------------------------------------
  1776.  
  1777.     NAME
  1778.         fcrypt
  1779.  
  1780.     DESCRIPTION
  1781.         Encrypts or decrypts a text or binary file using a modified XOR
  1782.         encryption method.  The same encryption key string must be used when
  1783.         decrypting the file as when encrypting it.
  1784.  
  1785.     SYNOPSIS
  1786.         #include "cxldef.h"
  1787.         int fcrypt(char *file,char *key);
  1788.  
  1789.     INPUTS
  1790.         file - address of filename string of file to encrypt or decrypt.
  1791.         key  - address of encryption key string.  The string can contain any
  1792.                ASCII characters (01 - FF).  The longer the string is, the
  1793.                better the encryption.  Do not lose the key, or you won't see
  1794.                your data again!
  1795.  
  1796.     RETURN VALUE
  1797.  
  1798.  
  1799.  
  1800.                                       24
  1801.  
  1802.  
  1803.         Nonzero if an error occurred.
  1804.  
  1805.     ALSO SEE
  1806.         strcode
  1807.  
  1808.     EXAMPLE
  1809.         fcrypt("CXL.DOC","This is my encryption key string");
  1810.  
  1811.     ------------------------------------------------------------------------
  1812.  
  1813.     NAME
  1814.         fill_
  1815.  
  1816.     DESCRIPTION
  1817.         Fills in a region of the screen with a specified character and
  1818.         attribute.
  1819.  
  1820.     SYNOPSIS
  1821.         #include "cxlvid.h"
  1822.         void fill_(int srow,int scol,int erow,int ecol,int ch,int attr);
  1823.  
  1824.     INPUTS
  1825.         srow - start row
  1826.         scol - start column
  1827.         erow - end row
  1828.         ecol - end column
  1829.         ch   - character to fill with
  1830.         attr - attribute of character
  1831.  
  1832.     ALSO SEE
  1833.         attrib  box_
  1834.  
  1835.     EXAMPLE
  1836.         fill_(5,15,16,42,'X',LRED|_MAGENTA);
  1837.  
  1838.     ------------------------------------------------------------------------
  1839.  
  1840.     NAME
  1841.         gameport
  1842.  
  1843.     DESCRIPTION
  1844.         Determines if a game port is installed.
  1845.  
  1846.     SYNOPSIS
  1847.         #include "cxldef.h"
  1848.         int gameport(void);
  1849.  
  1850.     RETURN VALUE
  1851.         Nonzero if a game port is installed.
  1852.  
  1853.     ALSO SEE
  1854.         mathchip  numflop  numpar  numser
  1855.  
  1856.     ------------------------------------------------------------------------
  1857.  
  1858.  
  1859.  
  1860.                                       25
  1861.  
  1862.  
  1863.     NAME
  1864.         getchf
  1865.  
  1866.     DESCRIPTION
  1867.         Gets a character from the keyboard from a list of valid characters.
  1868.         Provides Escape checking.
  1869.  
  1870.     SYNOPSIS
  1871.         #include "cxlkey.h"
  1872.         int getchf(char *valid,int defchar);
  1873.  
  1874.     INPUTS
  1875.         valid   - address of string containing list of valid characters
  1876.         defchar - default selection in case [Enter] is pressed, or zero if
  1877.                   you don't want to have a default selection
  1878.  
  1879.     RETURN VALUE
  1880.         The character pressed, or zero if the [Esc] key was pressed.
  1881.  
  1882.     ALSO SEE
  1883.         getxch  waitkey
  1884.  
  1885.     EXAMPLE
  1886.         int ch;
  1887.         printf("Are you sure? ");
  1888.         ch=getchf("YyNn",'Y');
  1889.         if(!ch) printf("[Esc] was pressed\n");
  1890.  
  1891.     ------------------------------------------------------------------------
  1892.  
  1893.     NAME
  1894.         getcursz
  1895.  
  1896.     DESCRIPTION
  1897.         Returns the start and stop scan lines of cursor.
  1898.  
  1899.     SYNOPSIS
  1900.         #include "cxlvid.h"
  1901.         void getcursz(int *sline,int *eline);
  1902.  
  1903.     INPUTS
  1904.         sline - address of integer to receive start scan line
  1905.         eline - address of integer to receive stop scan line
  1906.  
  1907.     ALSO SEE
  1908.         setcursz
  1909.  
  1910.     EXAMPLE
  1911.         int sline,eline;
  1912.         getcursz(&sline,&eline);
  1913.         printf("Cursor start & stop scan lines:  %d, %d\n",sline,eline);
  1914.  
  1915.     ------------------------------------------------------------------------
  1916.  
  1917.  
  1918.  
  1919.  
  1920.                                       26
  1921.  
  1922.  
  1923.     NAME
  1924.         getns
  1925.  
  1926.     DESCRIPTION
  1927.         Inputs a string of a specified maximum length from the keyboard.
  1928.         Provides Escape checking.
  1929.  
  1930.     SYNOPSIS
  1931.         #include "cxlkey.h"
  1932.         int getns(char *str,int maxchars);
  1933.  
  1934.     INPUTS
  1935.         str      - address of buffer to receive input string
  1936.         maxchars - maximum length of the input string
  1937.  
  1938.     RETURN VALUE
  1939.         Nonzero if the [Esc] key was pressed during user input.
  1940.  
  1941.     ALSO SEE
  1942.         inputsf
  1943.  
  1944.     EXAMPLE
  1945.         char name[11];
  1946.         printf("Enter your name: ");
  1947.         if(getns(name,10))
  1948.             printf("\n[Esc] was pressed\n");
  1949.         else
  1950.             printf("\nYour name is:  %s\n",name);
  1951.  
  1952.     ------------------------------------------------------------------------
  1953.  
  1954.     NAME
  1955.         getxch
  1956.  
  1957.     DESCRIPTION
  1958.         Gets a key (ASCII code/scan code) from the keyboard.  All CXL
  1959.         functions that interract with the keyboard call this function for
  1960.         input.
  1961.  
  1962.     SYNOPSIS
  1963.         #include "cxlkey.h"
  1964.         unsigned getxch(void);
  1965.  
  1966.     RETURN VALUE
  1967.         The keycode of the pressed key.  The keycode contains the scan code
  1968.         of the keypress in the upper byte, and the ASCII character in the
  1969.         lower byte.  A list of keycodes is in Appendix B.
  1970.  
  1971.     ALSO SEE
  1972.         getchf
  1973.  
  1974.     EXAMPLE
  1975.         unsigned int keycode;
  1976.         printf("Press a key:  ");
  1977.  
  1978.  
  1979.  
  1980.                                       27
  1981.  
  1982.  
  1983.         keycode=getxch();
  1984.         printf("%c\nkeycode = %#x, scancode = %d, ASCII code = %d\n"
  1985.             ,keycode,keycode,keycode>>8,keycode&0x00ff);
  1986.  
  1987.     ------------------------------------------------------------------------
  1988.  
  1989.     NAME
  1990.         gotoxy_
  1991.  
  1992.     DESCRIPTION
  1993.         Sets cursor coordinates on the screen.
  1994.  
  1995.     SYNOPSIS
  1996.         #include "cxlvid.h"
  1997.         void gotoxy_(int row,int col);
  1998.  
  1999.     INPUTS
  2000.         row - cursor row (Y coordinate)
  2001.         col - cursor column (X coordinate)
  2002.  
  2003.     ALSO SEE
  2004.         readcur
  2005.  
  2006.     ------------------------------------------------------------------------
  2007.  
  2008.     NAME
  2009.         hidecur
  2010.  
  2011.     DESCRIPTION
  2012.         Hides the cursor.  Retains the cursor shape so that when showcur()
  2013.         is called, the original cursor shape will be restored.
  2014.  
  2015.     SYNOPSIS
  2016.         #include "cxlvid.h"
  2017.         void hidecur(void);
  2018.  
  2019.     ALSO SEE
  2020.         lgcursor  setcursz  showcur  smcursor
  2021.  
  2022.     ------------------------------------------------------------------------
  2023.  
  2024.     NAME
  2025.         inputsf
  2026.  
  2027.     DESCRIPTION
  2028.         Inputs a formatted string from the keyboard.  This function provides
  2029.         an extremely powerful method of accept single-line input from the
  2030.         user.  You can limit input characters to certain characters of a
  2031.         type, such as numbers, insert strings in between typed in
  2032.         characters, create custom prompts, disable [Enter] until the field
  2033.         is filled, and more.  Provides Escape checking.
  2034.  
  2035.     SYNOPSIS
  2036.         #include "cxlkey.h"
  2037.  
  2038.  
  2039.  
  2040.                                       28
  2041.  
  2042.  
  2043.         int inputsf(char *str,char *fmt);
  2044.  
  2045.     INPUTS
  2046.         str - address of the buffer receive input string
  2047.         fmt - address of the format string.  See Appendix D for valid format
  2048.               string characters.
  2049.  
  2050.     RETURN VALUE
  2051.         0 - no error
  2052.         1 - [Esc] key was pressed
  2053.         2 - invalid format string
  2054.  
  2055.     ALSO SEE
  2056.         getns
  2057.  
  2058.     EXAMPLE
  2059.         char buf[21];
  2060.         if(inputsf(buf,"'Enter your name:  '!M!AAAAAAAAAAAAAAAAAAAA")==1)
  2061.             printf("\n[Esc] key was pressed\n");
  2062.         else
  2063.             printf("\nYour name is:  %s\n",buf);
  2064.  
  2065.     ------------------------------------------------------------------------
  2066.  
  2067.     NAME
  2068.         kbclear
  2069.  
  2070.     DESCRIPTION
  2071.         Clears CXL's internal keyboard buffer.
  2072.  
  2073.     SYNOPSIS
  2074.         #include "cxlkey.h"
  2075.         void kbclear(void);
  2076.  
  2077.     ALSO SEE
  2078.         clearkeys  kbmhit  kbput  kbputs
  2079.  
  2080.     ------------------------------------------------------------------------
  2081.  
  2082.     NAME
  2083.         kbmhit
  2084.  
  2085.     DESCRIPTION
  2086.         Determines if a key has been pressed and is waiting to be got. Also
  2087.         checks for mouse button presses.  Replaces the kbhit() function.
  2088.  
  2089.     SYNOPSIS
  2090.         #include "cxlkey.h"
  2091.         int kbmhit(void);
  2092.  
  2093.     RETURN VALUE
  2094.         Nonzero if a key is waiting to be got.
  2095.  
  2096.     ALSO SEE
  2097.  
  2098.  
  2099.  
  2100.                                       29
  2101.  
  2102.  
  2103.         kbclear
  2104.  
  2105.     ------------------------------------------------------------------------
  2106.  
  2107.     NAME
  2108.         kbput
  2109.  
  2110.     DESCRIPTION
  2111.         Places a keystroke into CXL's internal keyboard buffer.  This will
  2112.         only affect CXL's keyboard input functions.  This function is useful
  2113.         for making keyboard scripts for demos, etc., or forcing user
  2114.         keyboard input.
  2115.  
  2116.     SYNOPSIS
  2117.         #include "cxlkey.h"
  2118.         int kbput(unsigned xch);
  2119.  
  2120.     INPUTS
  2121.         xch - keycode of keypress to place in buffer.  The scan code will be
  2122.               in the high byte and the ASCII code will be in the low byte.
  2123.               See Appendix B for a list of keycodes which you can use.
  2124.  
  2125.     RETURN VALUE
  2126.         Nonzero if memory allocation error.
  2127.  
  2128.     ALSO SEE
  2129.         kbclear  kbputs
  2130.  
  2131.     EXAMPLE
  2132.         kbput(0x011b);  /* puts an [Esc] keypress into CXL's buffer */
  2133.  
  2134.     ------------------------------------------------------------------------
  2135.  
  2136.     NAME
  2137.         kbputs
  2138.  
  2139.     DESCRIPTION
  2140.         Places a string of characters into CXL's internal keyboard buffer.
  2141.         This will only affect CXL's keyboard input functions.  This function
  2142.         is useful for making keyboard scripts for demos, etc., and forcing
  2143.         user keyboard input.
  2144.  
  2145.     SYNOPSIS
  2146.         #include "cxlkey.h"
  2147.         int kbputs(char *str);
  2148.  
  2149.     INPUTS
  2150.         str - address of string of characters to stuff into buffer
  2151.  
  2152.     RETURN VALUE
  2153.         Nonzero if memory allocation error.
  2154.  
  2155.     ALSO SEE
  2156.         kbclear  kbput
  2157.  
  2158.  
  2159.  
  2160.                                       30
  2161.  
  2162.  
  2163.     EXAMPLE
  2164.         char buf[21];
  2165.         kbputs("Mike");
  2166.         printf("Enter your name:  ");
  2167.         getns(buf,20);
  2168.  
  2169.     ------------------------------------------------------------------------
  2170.  
  2171.     NAME
  2172.         kbstat
  2173.  
  2174.     DESCRIPTION
  2175.         Returns the status of the keyboard control keys.
  2176.  
  2177.     SYNOPSIS
  2178.         #include "cxlkey.h"
  2179.         unsigned kbstat(void);
  2180.  
  2181.     RETURN VALUE
  2182.         Status word of the keyboard flag.  You can determine which key(s)
  2183.         are being pressed/toggled by masking the status word (using the
  2184.         bitwise '&' operator) with one of the following:
  2185.             RSHIFT   - right shift pressed
  2186.             LSHIFT   - left shift pressed
  2187.             CTRL     - <Ctrl> pressed
  2188.             ALT      - <Alt> pressed
  2189.             SCRLOCK  - <Scroll Lock> toggled
  2190.             NUMLOCK  - <Num Lock> toggled
  2191.             CAPSLOCK - <Caps Lock> toggled
  2192.             INS      - <Ins> toggled
  2193.  
  2194.     ALSO SEE
  2195.         capsoff  capson  numoff  numon
  2196.  
  2197.     EXAMPLE
  2198.         printf("NumLock is %s\n",(kbstat()&NUMLOCK)?"on":"off");
  2199.  
  2200.     ------------------------------------------------------------------------
  2201.  
  2202.     NAME
  2203.         lcrlf
  2204.  
  2205.     DESCRIPTION
  2206.         Prints a carriage return and line feed on the printer (PRN).
  2207.  
  2208.     SYNOPSIS
  2209.         #include "cxlprn.h"
  2210.         void lcrlf(void);
  2211.  
  2212.     ALSO SEE
  2213.         lprintc  lprintf  lprints
  2214.  
  2215.     ------------------------------------------------------------------------
  2216.  
  2217.  
  2218.  
  2219.  
  2220.                                       31
  2221.  
  2222.  
  2223.     NAME
  2224.         lgcursor
  2225.  
  2226.     DESCRIPTION
  2227.         Makes the cursor large.
  2228.  
  2229.     SYNOPSIS
  2230.         #include "cxlvid.h"
  2231.         void lgcursor(void);
  2232.  
  2233.     ALSO SEE
  2234.         hidecur  setcursz  showcur  smcursor
  2235.  
  2236.     ------------------------------------------------------------------------
  2237.  
  2238.     NAME
  2239.         lprintc
  2240.  
  2241.     DESCRIPTION
  2242.         Prints a character on the printer (PRN).
  2243.  
  2244.     SYNOPSIS
  2245.         #include "cxlprn.h"
  2246.         void lprintc(int ch);
  2247.  
  2248.     INPUTS
  2249.         ch - the character to print
  2250.  
  2251.     ALSO SEE
  2252.         lcrlf  lprintf
  2253.  
  2254.     EXAMPLE
  2255.         lprintc(12);    /* sends a form feed to the printer */
  2256.  
  2257.     ------------------------------------------------------------------------
  2258.  
  2259.     NAME
  2260.         lprintf
  2261.  
  2262.     DESCRIPTION
  2263.         Sends formatted output to the printer (PRN).  Works similar to the
  2264.         standard C printf() function.
  2265.  
  2266.     SYNOPSIS
  2267.         #include "cxlprn.h"
  2268.         void lprintf(const char *format,...);
  2269.  
  2270.     INPUTS
  2271.         format - format string.  Refer to the section on printf() in your
  2272.                  compiler's run-time library reference.
  2273.         ...    - any additional arguments
  2274.  
  2275.     ALSO SEE
  2276.         lcrlf  lprintc  lprintns  lprints
  2277.  
  2278.  
  2279.  
  2280.                                       32
  2281.  
  2282.  
  2283.     EXAMPLE
  2284.         char s[]="Hello";
  2285.         int i=5;
  2286.         char c='Z';
  2287.         lprintf("s = %s, i = %d, c = %c\n\f",s,i,c);
  2288.  
  2289.     ------------------------------------------------------------------------
  2290.  
  2291.     NAME
  2292.         lprintns
  2293.  
  2294.     DESCRIPTION
  2295.         Prints a string to a fixed width on the printer (PRN).
  2296.  
  2297.     SYNOPSIS
  2298.         #include "cxlprn.h"
  2299.         void lprintns(char *str,int width);
  2300.  
  2301.     INPUTS
  2302.         str   - the address of the string to print
  2303.         width - width to print string, either by padding or truncating.
  2304.  
  2305.     ALSO SEE
  2306.         lcrlf  lprintf  lprints  lprintsu
  2307.  
  2308.     EXAMPLE
  2309.         char string[]="Hello, world";
  2310.         lprintns(string,5);
  2311.         lprintf(".\n");
  2312.         lprintns(string,20);
  2313.         lprintf(".\n");
  2314.  
  2315.     ------------------------------------------------------------------------
  2316.  
  2317.     NAME
  2318.         lprints
  2319.  
  2320.     DESCRIPTION
  2321.         Prints a string on the printer (PRN).
  2322.  
  2323.     SYNOPSIS
  2324.         #include "cxlprn.h"
  2325.         void lprints(char *str);
  2326.  
  2327.     INPUTS
  2328.         str - the address of the string to print
  2329.  
  2330.     ALSO SEE
  2331.         lcrlf  lprintf  lprintns  lprintsu
  2332.  
  2333.     EXAMPLE
  2334.         lprints("Hello, world\n");
  2335.  
  2336.     ------------------------------------------------------------------------
  2337.  
  2338.  
  2339.  
  2340.                                       33
  2341.  
  2342.  
  2343.     NAME
  2344.         lprintsb
  2345.  
  2346.     DESCRIPTION
  2347.         Prints a bold-faced string on the printer (PRN).
  2348.  
  2349.     SYNOPSIS
  2350.         #include "cxlprn.h"
  2351.         void lprintsb(char *str,int reps);
  2352.  
  2353.     INPUTS
  2354.         str  - address of the string to print
  2355.         reps - number of strike repetitions (the more, the darker the print)
  2356.  
  2357.     ALSO SEE
  2358.         lcrlf  lprintf  lprintns  lprints  lprintsu
  2359.  
  2360.     ------------------------------------------------------------------------
  2361.  
  2362.     NAME
  2363.         lprintsu
  2364.  
  2365.     DESCRIPTION
  2366.         Prints an underlined string on the printer (PRN).
  2367.  
  2368.     SYNOPSIS
  2369.         #include "cxlprn.h"
  2370.         void lprintsu(char *str);
  2371.  
  2372.     INPUTS
  2373.         str - address of the string to print
  2374.  
  2375.     ALSO SEE
  2376.         lcrlf  lprintf  lprintns  lprints  lprintsb
  2377.  
  2378.     ------------------------------------------------------------------------
  2379.  
  2380.     NAME
  2381.         machid
  2382.  
  2383.     DESCRIPTION
  2384.         Returns the value of the machine ROM ID byte.
  2385.  
  2386.     SYNOPSIS
  2387.         #include "cxldef.h"
  2388.         int machid(void);
  2389.  
  2390.     RETURN VALUE
  2391.         The value of the machine ROM ID byte.  Will usually be one of the
  2392.         following values.  Any other value is unknown.
  2393.             IBMPC    - IBM PC
  2394.             IBMPCXT  - IBM PC/XT
  2395.             IBMPCJR  - IBM PCjr
  2396.             IBMPCAT  - IBM PC/AT
  2397.  
  2398.  
  2399.  
  2400.                                       34
  2401.  
  2402.  
  2403.             IBMPCXT2 - IBM PC/XT-2
  2404.             IBMCONV  - IBM PC Convertible
  2405.             SPERRYPC - Sperry PC
  2406.  
  2407.     ALSO SEE
  2408.         biosver
  2409.  
  2410.     ------------------------------------------------------------------------
  2411.  
  2412.     NAME
  2413.         mapattr
  2414.  
  2415.     DESCRIPTION
  2416.         Translates a color text attribute into its approximate monochrome
  2417.         equivalent.  All of CXL's video functions automatically call this,
  2418.         so you would only need to call this for your own functions.
  2419.  
  2420.     SYNOPSIS
  2421.         #include "cxlvid.h"
  2422.         int mapattr(int attr);
  2423.  
  2424.     INPUTS
  2425.         attr - the color text attribute to translate
  2426.  
  2427.     RETURN VALUE
  2428.         The monochrome equivalent of the color text attribute.
  2429.  
  2430.     ALSO SEE
  2431.         revsattr
  2432.  
  2433.     EXAMPLE
  2434.         int attr=LCYAN|_BLUE;
  2435.         prints(0,0,attr,"In living color!");
  2436.         _vinfo.mapattr=1;   /* force monochrome attributes */
  2437.         prints(1,0,mapattr(attr),"In dull monochrome....");
  2438.  
  2439.     ------------------------------------------------------------------------
  2440.  
  2441.     NAME
  2442.         mathchip
  2443.  
  2444.     DESCRIPTION
  2445.         Determines if a math coprocessor is installed.
  2446.  
  2447.     SYNOPSIS
  2448.         #include "cxldef.h"
  2449.         int mathchip(void);
  2450.  
  2451.     RETURN VALUE
  2452.         Nonzero if a math coprocessor is installed.
  2453.  
  2454.     ALSO SEE
  2455.         gameport  numflop  numpar  numser
  2456.  
  2457.  
  2458.  
  2459.  
  2460.                                       35
  2461.  
  2462.  
  2463.     EXAMPLE
  2464.         printf("You do %shave a math coprocessor\n",mathchip()?"":"not ");
  2465.  
  2466.     ------------------------------------------------------------------------
  2467.  
  2468.     NAME
  2469.         mode
  2470.  
  2471.     DESCRIPTION
  2472.         Sets the video mode.
  2473.  
  2474.     SYNOPSIS
  2475.         #include "cxlvid.h"
  2476.         void mode(int mode_code);
  2477.  
  2478.     INPUTS
  2479.         mode_code - video mode code
  2480.  
  2481.     ALSO SEE
  2482.         setlines  vidtype
  2483.  
  2484.     ------------------------------------------------------------------------
  2485.  
  2486.     NAME
  2487.         msbclear
  2488.  
  2489.     DESCRIPTION
  2490.         Clears the mouse driver's "button presses" and "button releases"
  2491.         counters (removes them from the queue).
  2492.  
  2493.     SYNOPSIS
  2494.         #include "cxlmou.h"
  2495.         void msbclear(void);
  2496.  
  2497.     ALSO SEE
  2498.         kbmhit  msbpress  msbreles  msinit  msstatus
  2499.  
  2500.     ------------------------------------------------------------------------
  2501.  
  2502.     NAME
  2503.         msbpress
  2504.  
  2505.     DESCRIPTION
  2506.         Returns information about the specific button presses of mouse.
  2507.  
  2508.     SYNOPSIS
  2509.         #include "cxlmou.h"
  2510.         void msbpress(int button,int *bstat,int *bcount,int *row,int *col);
  2511.  
  2512.     INPUTS
  2513.         button - button to check:
  2514.                     0 - left button
  2515.                     1 - right button
  2516.                     2 - middle button (if applicable)
  2517.  
  2518.  
  2519.  
  2520.                                       36
  2521.  
  2522.  
  2523.         bstat  - address of integer to receive button status word.  Possible
  2524.                  button status values are:
  2525.                     0 - no buttons pressed
  2526.                     1 - left button pressed
  2527.                     2 - right button pressed
  2528.                     4 - middle button pressed (if applicable)
  2529.                     3 - left & right buttons pressed
  2530.                     5 - left & middle buttons pressed (if applicable)
  2531.                     6 - middle & right buttons pressed (if applicable)
  2532.                     7 - all 3 buttons pressed (if applicable)
  2533.         bcount - address of integer to receive number of times pressed since
  2534.                  last call
  2535.         row    - address of integer to receive row at time of button press
  2536.         col    - address of integer to receive column at time of button
  2537.                  press
  2538.  
  2539.     ALSO SEE
  2540.         msbclear  msbreles  msinit  msstatus
  2541.  
  2542.     EXAMPLE
  2543.         int bstat,bcount,row,col;
  2544.         msbpress(0,&bstat,&bcount,&row,&col);
  2545.  
  2546.     ------------------------------------------------------------------------
  2547.  
  2548.     NAME
  2549.         msbreles
  2550.  
  2551.     DESCRIPTION
  2552.         Returns informmation about specific button releases of mouse.
  2553.  
  2554.     SYNOPSIS
  2555.         #include "cxlmou.h"
  2556.         void msbreles(int button,int *bstat,int *bcount,int *row,int *col);
  2557.  
  2558.     INPUTS
  2559.         button - button to check:
  2560.                     0 - left button
  2561.                     1 - right button
  2562.                     2 - middle button (if applicable)
  2563.         bstat  - address of integer to receive button status word.  Possible
  2564.                  button status values are:
  2565.                     0 - no buttons pressed
  2566.                     1 - left button pressed
  2567.                     2 - right button pressed
  2568.                     4 - middle button pressed (if applicable)
  2569.                     3 - left & right buttons pressed
  2570.                     5 - left & middle buttons pressed (if applicable)
  2571.                     6 - middle & right buttons pressed (if applicable)
  2572.                     7 - all 3 buttons pressed (if applicable)
  2573.         bcount - address of integer to receive number of times released
  2574.                  since last call
  2575.         row    - address of integer to receive row at time of button release
  2576.         col    - address of integer to receive column at time of button
  2577.  
  2578.  
  2579.  
  2580.                                       37
  2581.  
  2582.  
  2583.                  release
  2584.  
  2585.     ALSO SEE
  2586.         msbclear  msbpress  msinit  msstatus
  2587.  
  2588.     EXAMPLE
  2589.         int bstat,bcount,row,col;
  2590.         msbreles(0,&bstat,&bcount,&row,&col);
  2591.  
  2592.     ------------------------------------------------------------------------
  2593.  
  2594.     NAME
  2595.         mscondoff
  2596.  
  2597.     DESCRIPTION
  2598.         Conditionally hides the mouse cursor depending on whether or not the
  2599.         mouse cursor falls within the input screen coordinates.
  2600.  
  2601.     SYNOPSIS
  2602.         #include "cxlmou.h"
  2603.         void mscondoff(int srow,int scol,int erow,int ecol);
  2604.  
  2605.     INPUTS
  2606.         srow - start row
  2607.         scol - start column
  2608.         erow - end row
  2609.         ecol - end column
  2610.  
  2611.     ALSO SEE
  2612.         mshidecur  msinit  msshowcur
  2613.  
  2614.     ------------------------------------------------------------------------
  2615.  
  2616.     NAME
  2617.         mscursor
  2618.  
  2619.     DESCRIPTION
  2620.         Sets the mouse text cursor type.  The mouse cursor can be a hardware
  2621.         or softare cursor.  The hardware cursor is the same as the normal
  2622.         cursor you see when you are at the DOS prompt.  Because the mouse's
  2623.         hardware cursor is the same as the normal cursor, they can interfere
  2624.         with each other, making this method impractical to use in most
  2625.         cases.  The software mouse cursor is a text box that can reveal the
  2626.         underlying character.  This is the cursor most used by programs
  2627.         including other CXL mouse support functions.
  2628.  
  2629.     SYNOPSIS
  2630.         #include "cxlmou.h"
  2631.         void mscursor(unsigned curtype,unsigned smask,unsigned cmask);
  2632.  
  2633.     INPUTS
  2634.         curtype - cursor type.  0=software, 1=hardware
  2635.         smask   - screen mask (software cursor) or start scan line (hardware
  2636.                   cursor).  If using a software cursor, the screen mask
  2637.  
  2638.  
  2639.  
  2640.                                       38
  2641.  
  2642.  
  2643.                   determines which of the characters attributes are
  2644.                   preserved. It is ANDed with the screen character and
  2645.                   attribute.  The bit format for both smask and cmask are:
  2646.                       Bit     Content
  2647.                       ---     -------
  2648.                       0-7   - ASCII character code
  2649.                       8-10  - foreground color
  2650.                       11    - 0=intensity off, 1=intensity on
  2651.                       12-14 - background color
  2652.                       15    - 0=no blink, 1=blink
  2653.         cmask   - cursor mask (software cursor) or stop scan line (hardware
  2654.                   cursor).  If using a software cursor, the cursor mask is
  2655.                   used to determine which of the characteristics are changed
  2656.                   by the cursor.  The cmask is XORed with the result of
  2657.                   (smask AND character-attribute).  The bit values for cmask
  2658.                   are the same as those for smask.
  2659.  
  2660.     ALSO SEE
  2661.         msinit  msshowcur
  2662.  
  2663.     EXAMPLE
  2664.         mscursor(1,1,7);    /* makes a full-block hardware cursor */
  2665.         msshowcur();
  2666.  
  2667.     ------------------------------------------------------------------------
  2668.  
  2669.     NAME
  2670.         msgotoxy
  2671.  
  2672.     DESCRIPTION
  2673.         Sets the mouse cursor coordinates.
  2674.  
  2675.     SYNOPSIS
  2676.         #include "cxlmou.h"
  2677.         void msgotoxy(int row,int col);
  2678.  
  2679.     INPUTS
  2680.         row - row (Y coordinate)
  2681.         col - column (X coordinate)
  2682.  
  2683.     ALSO SEE
  2684.         msinit  msstatus
  2685.  
  2686.     EXAMPLE
  2687.         msgotoxy(13,45);    /* sets mouse cursor to row 13, column 45 */
  2688.  
  2689.     ------------------------------------------------------------------------
  2690.  
  2691.     NAME
  2692.         mshbounds
  2693.  
  2694.     DESCRIPTION
  2695.         Sets the mouse's upper and lower horizontal bounds.
  2696.  
  2697.  
  2698.  
  2699.  
  2700.                                       39
  2701.  
  2702.  
  2703.     SYNOPSIS
  2704.         #include "cxlmou.h"
  2705.         void mshbounds(int leftcol,int rightcol);
  2706.  
  2707.     INPUTS
  2708.         leftcol  - left column boundary
  2709.         rightcol - right column boundary
  2710.  
  2711.     ALSO SEE
  2712.         msinit  msvbounds
  2713.  
  2714.     EXAMPLE
  2715.         mshbounds(5,45);    /* restricts mouse cursor movement */
  2716.                             /* between columns 5 & 45          */
  2717.  
  2718.     ------------------------------------------------------------------------
  2719.  
  2720.     NAME
  2721.         mshidecur
  2722.  
  2723.     DESCRIPTION
  2724.         Hides the mouse cursor.
  2725.  
  2726.     SYNOPSIS
  2727.         #include "cxlmou.h"
  2728.         void mshidecur(void);
  2729.  
  2730.     ALSO SEE
  2731.         msinit  msshowcur
  2732.  
  2733.     ------------------------------------------------------------------------
  2734.  
  2735.     NAME
  2736.         msinit
  2737.  
  2738.     DESCRIPTION
  2739.         Determines if a mouse is present.  If so, initializes mouse and sets
  2740.         the global variable _mouse to a MS_KEYS which causes mouse movements
  2741.         to be translated to the keyboard arrow keys.
  2742.  
  2743.     SYNOPSIS
  2744.         #include "cxlmou.h"
  2745.         int msinit(void);
  2746.  
  2747.     RETURN VALUE
  2748.         Nonzero if mouse is present.
  2749.  
  2750.     ALSO SEE
  2751.         mssupport
  2752.  
  2753.     EXAMPLE
  2754.         if(msinit())
  2755.             printf("Mouse initialized\n");
  2756.         else
  2757.  
  2758.  
  2759.  
  2760.                                       40
  2761.  
  2762.  
  2763.             printf("Mouse does not exist\n");
  2764.  
  2765.     ------------------------------------------------------------------------
  2766.  
  2767.     NAME
  2768.         msmotion
  2769.  
  2770.     DESCRIPTION
  2771.         Gets information about the movement of the mouse.
  2772.  
  2773.     SYNOPSIS
  2774.         #include "cxlmou.h"
  2775.         void msmotion(int *rowcount,int *colcount);
  2776.  
  2777.     INPUTS
  2778.         rowcount - address of integer to receive number of rows moved
  2779.         colcount - address of integer to receive number of columns moved
  2780.  
  2781.     ALSO SEE
  2782.         msinit  msstatus
  2783.  
  2784.     EXAMPLE
  2785.         int rowcount,colcount;
  2786.         msmotion(&rowcount,&colcount);
  2787.  
  2788.     ------------------------------------------------------------------------
  2789.  
  2790.     NAME
  2791.         msshowcur
  2792.  
  2793.     DESCRIPTION
  2794.         Reveals the hidden mouse cursor.
  2795.  
  2796.     SYNOPSIS
  2797.         #include "cxlmou.h"
  2798.         void msshowcur(void);
  2799.  
  2800.     ALSO SEE
  2801.         mscursor  mshidecur  msinit
  2802.  
  2803.     ------------------------------------------------------------------------
  2804.  
  2805.     NAME
  2806.         msspeed
  2807.  
  2808.     DESCRIPTION
  2809.         Adjusts the mouse's speed by changing its sensitivity.
  2810.  
  2811.     SYNOPSIS
  2812.         #include "cxlmou.h"
  2813.         void msspeed(int xratio,int yratio);
  2814.  
  2815.     INPUTS
  2816.         xratio - horizontal speed (higher numbers are slower)
  2817.  
  2818.  
  2819.  
  2820.                                       41
  2821.  
  2822.  
  2823.         yratio - vertical speed (higher numbers are slower)
  2824.  
  2825.     ALSO SEE
  2826.         msinit
  2827.  
  2828.     ------------------------------------------------------------------------
  2829.  
  2830.     NAME
  2831.         msstatus
  2832.  
  2833.     DESCRIPTION
  2834.         Returns the status of the mouse.
  2835.  
  2836.     SYNOPSIS
  2837.         #include "cxlmou.h"
  2838.         void msstatus(int *bstat,int *row,int *col);
  2839.  
  2840.     INPUTS
  2841.         bstat - address of integer to receive button status word.  Possible
  2842.                 button status values are:
  2843.                     0 - no buttons pressed
  2844.                     1 - left button pressed
  2845.                     2 - right button pressed
  2846.                     4 - middle button pressed (if applicable)
  2847.                     3 - left & right buttons pressed
  2848.                     5 - left & middle buttons pressed (if applicable)
  2849.                     6 - middle & right buttons pressed (if applicable)
  2850.                     7 - all 3 buttons pressed (if applicable)
  2851.         row   - address of integer to receive current row coordinate
  2852.         col   - address of integer to receive current column coordinate
  2853.  
  2854.     ALSO SEE
  2855.         msinit
  2856.  
  2857.     EXAMPLE
  2858.         int bstat,row,col;
  2859.         msstatus(&bstat,&row,&col);
  2860.         printf("The mouse cursor is at row %d, column %d\n",row,col);
  2861.  
  2862.     ------------------------------------------------------------------------
  2863.  
  2864.     NAME
  2865.         mssupport
  2866.  
  2867.     DESCRIPTION
  2868.         Selects the type of mouse support to be used by CXL functions which
  2869.         support them.  If no mouse exists, the call to this function is
  2870.         ignored. This function should be called after msinit().
  2871.  
  2872.     SYNOPSIS
  2873.         #include "cxlmou.h"
  2874.         void mssupport(int type);
  2875.  
  2876.     INPUTS
  2877.  
  2878.  
  2879.  
  2880.                                       42
  2881.  
  2882.  
  2883.         type - type of mouse support.  Can be one of the following:
  2884.                    MS_NONE - no mouse support
  2885.                    MS_KEYS - mouse movements are translated into keystrokes.
  2886.                              This is the default set by msinit() if it finds
  2887.                              a mouse driver present.
  2888.                    MS_CURS - point-and-shoot mouse cursor where supported
  2889.                    MS_FULL - full mouse support.  If a CXL function supports
  2890.                              a point-and-shoot mouse cursor, then that will
  2891.                              be used, otherwise mouse movements will be
  2892.                              translated into keystrokes.
  2893.  
  2894.     ALSO SEE
  2895.         msinit
  2896.  
  2897.     EXAMPLE
  2898.         mssupport(MS_FULL);
  2899.  
  2900.     ------------------------------------------------------------------------
  2901.  
  2902.     NAME
  2903.         msvbounds
  2904.  
  2905.     DESCRIPTION
  2906.         Sets the mouse's left and right vertical bounds.
  2907.  
  2908.     SYNOPSIS
  2909.         #include "cxlmou.h"
  2910.         void msvbounds(int toprow,int botrow);
  2911.  
  2912.     INPUTS
  2913.         toprow - top row boundary
  2914.         botrow - bottom row boundary
  2915.  
  2916.     ALSO SEE
  2917.         mshbounds  msinit
  2918.  
  2919.     EXAMPLE
  2920.         msvbounds(3,20);    /* restricts mouse cursor movement */
  2921.                             /* between rows 3 and 20           */
  2922.  
  2923.     ------------------------------------------------------------------------
  2924.  
  2925.     NAME
  2926.         numflop
  2927.  
  2928.     DESCRIPTION
  2929.         Returns the number of floppy disk drives installed.
  2930.  
  2931.     SYNOPSIS
  2932.         #include "cxldef.h"
  2933.         int numflop(void);
  2934.  
  2935.     RETURN VALUE
  2936.         The number of floppy disk drives installed
  2937.  
  2938.  
  2939.  
  2940.                                       43
  2941.  
  2942.  
  2943.     ALSO SEE
  2944.         gameport  mathchip  numpar  numser
  2945.  
  2946.     EXAMPLE
  2947.         printf("You have %d floppy drives installed\n",numflop());
  2948.  
  2949.     ------------------------------------------------------------------------
  2950.  
  2951.     NAME
  2952.         numoff
  2953.  
  2954.     DESCRIPTION
  2955.         Toggles the NumLock key off.
  2956.  
  2957.     SYNOPSIS
  2958.         #include "cxlkey.h"
  2959.         void numoff(void);
  2960.  
  2961.     ALSO SEE
  2962.         capsoff  kbstat  numon
  2963.  
  2964.     ------------------------------------------------------------------------
  2965.  
  2966.     NAME
  2967.         numon
  2968.  
  2969.     DESCRIPTION
  2970.         Toggles the NumLock key on.
  2971.  
  2972.     SYNOPSIS
  2973.         #include "cxlkey.h"
  2974.         void numon(void);
  2975.  
  2976.     ALSO SEE
  2977.         capson  kbstat  numoff
  2978.  
  2979.     ------------------------------------------------------------------------
  2980.  
  2981.     NAME
  2982.         numpar
  2983.  
  2984.     DESCRIPTION
  2985.         Returns the number of parallel ports.
  2986.  
  2987.     SYNOPSIS
  2988.         #include "cxldef.h"
  2989.         int numpar(void);
  2990.  
  2991.     RETURN VALUE
  2992.         The number of parallel ports installed.
  2993.  
  2994.     ALSO SEE
  2995.         gameport  mathchip  numflop  numser
  2996.  
  2997.  
  2998.  
  2999.  
  3000.                                       44
  3001.  
  3002.  
  3003.     EXAMPLE
  3004.         printf("You have %d parallel ports\n",numpar());
  3005.  
  3006.     ------------------------------------------------------------------------
  3007.  
  3008.     NAME
  3009.         numser
  3010.  
  3011.     DESCRIPTION
  3012.         Returns the number of serial ports installed.
  3013.  
  3014.     SYNOPSIS
  3015.         #include "cxldef.h"
  3016.         int numser(void);
  3017.  
  3018.     RETURN VALUE
  3019.         The number of serial ports installed.
  3020.  
  3021.     ALSO SEE
  3022.         gameport  mathchip  numflop  numpar
  3023.  
  3024.     EXAMPLE
  3025.         printf("You have %d serial ports\n",numser());
  3026.  
  3027.     ------------------------------------------------------------------------
  3028.  
  3029.     NAME
  3030.         printc
  3031.  
  3032.     DESCRIPTION
  3033.         Displays a character to the screen at a specified location, using a
  3034.         specified attribute.  Does not recognize control characters.  Does
  3035.         not affect cursor position.
  3036.  
  3037.     SYNOPSIS
  3038.         #include "cxlvid.h"
  3039.         void printc(int row,int col,int attr,int ch);
  3040.  
  3041.     INPUTS
  3042.         row  - row to display character at
  3043.         col  - column to display character at
  3044.         attr - text attribute for character
  3045.         ch   - character to print
  3046.  
  3047.     ALSO SEE
  3048.         attrib  prints
  3049.  
  3050.     EXAMPLE
  3051.         printc(12,40,BLINK|LRED|_BLACK,'!');
  3052.  
  3053.     ------------------------------------------------------------------------
  3054.  
  3055.     NAME
  3056.         prints
  3057.  
  3058.  
  3059.  
  3060.                                       45
  3061.  
  3062.  
  3063.     DESCRIPTION
  3064.         Displays a string on the screen at a specified location, using a
  3065.         specified attribute.  Does not affect cursor position.
  3066.  
  3067.     SYNOPSIS
  3068.         #include "cxlvid.h"
  3069.         void prints(int row,int col,int attr,char *str);
  3070.  
  3071.     INPUTS
  3072.         row  - row to display string at
  3073.         col  - column to display string at
  3074.         attr - text attribute for characters displayed
  3075.         str  - address of string to display
  3076.  
  3077.     ALSO SEE
  3078.         attrib  printc
  3079.  
  3080.     EXAMPLE
  3081.         prints(24,15,YELLOW|_BROWN,"Hello, world");
  3082.  
  3083.     ------------------------------------------------------------------------
  3084.  
  3085.     NAME
  3086.         putchat
  3087.  
  3088.     DESCRIPTION
  3089.         Puts a character and its attribute on the screen at current cursor
  3090.         position using video BIOS calls.
  3091.  
  3092.     SYNOPSIS
  3093.         #include "cxlvid.h"
  3094.         void putchat(int ch,int attr);
  3095.  
  3096.     INPUTS
  3097.         ch   - character to display
  3098.         attr - attribute to display character in
  3099.  
  3100.     ALSO SEE
  3101.         readchat
  3102.  
  3103.     ------------------------------------------------------------------------
  3104.  
  3105.     NAME
  3106.         randfile
  3107.  
  3108.     DESCRIPTION
  3109.         Creates a random file name.
  3110.  
  3111.     SYNOPSIS
  3112.         #include "cxldef.h"
  3113.         char *randfile(void);
  3114.  
  3115.     RETURN VALUE
  3116.         Address of the static string containing the random file name.
  3117.  
  3118.  
  3119.  
  3120.                                       46
  3121.  
  3122.  
  3123.     EXAMPLE
  3124.         printf("A random file name is:  %s\n",randfile());
  3125.  
  3126.     ------------------------------------------------------------------------
  3127.  
  3128.     NAME
  3129.         readchat
  3130.  
  3131.     DESCRIPTION
  3132.         Reads the character and attribute under the cursor using video BIOS
  3133.         calls.
  3134.  
  3135.     SYNOPSIS
  3136.         #include "cxlvid.h"
  3137.         unsigned readchat(void);
  3138.  
  3139.     RETURN VALUE
  3140.         Unsigned integer containing the character in the low byte and
  3141.         attribute in the high byte.
  3142.  
  3143.     ALSO SEE
  3144.         putchat  revattr  setattr
  3145.  
  3146.     EXAMPLE
  3147.         unsigned int chat;
  3148.         chat=readchat();
  3149.         printf("character value = %d, attribute value = %d\n",chat&0x00ff
  3150.             ,chat>>8);
  3151.  
  3152.     ------------------------------------------------------------------------
  3153.  
  3154.     NAME
  3155.         readcur
  3156.  
  3157.     DESCRIPTION
  3158.         Reads the current cursor location.
  3159.  
  3160.     SYNOPSIS
  3161.         #include "cxlvid.h"
  3162.         void readcur(int *row,int *col);
  3163.  
  3164.     INPUTS
  3165.         row - address of integer to receive cursor row
  3166.         col - address of integer to receive cursor column
  3167.  
  3168.     ALSO SEE
  3169.         gotoxy_
  3170.  
  3171.     EXAMPLE
  3172.         int row,col;
  3173.         readcur(&row,&col);
  3174.         printf("The cursor is at row %d, column %d\n",row,col);
  3175.  
  3176.     ------------------------------------------------------------------------
  3177.  
  3178.  
  3179.  
  3180.                                       47
  3181.  
  3182.  
  3183.     NAME
  3184.         revattr
  3185.  
  3186.     DESCRIPTION
  3187.         Reverses the attribute of the character under the current cursor
  3188.         position, and continues for the specified number of characters.
  3189.         Uses video BIOS calls.
  3190.  
  3191.     SYNOPSIS
  3192.         #include "cxlvid.h"
  3193.         void revattr(int count);
  3194.  
  3195.     INPUTS
  3196.         count - the number of characters to reverse the attribute of
  3197.  
  3198.     ALSO SEE
  3199.         readchat  revsattr  setattr
  3200.  
  3201.     EXAMPLE
  3202.         prints(0,0,LCYAN|_BLUE,"Hello, world");
  3203.         gotoxy_(0,0);
  3204.         revattr(5);
  3205.  
  3206.     ------------------------------------------------------------------------
  3207.  
  3208.     NAME
  3209.         revsattr
  3210.  
  3211.     DESCRIPTION
  3212.         Returns the inverse of the given text attribute.
  3213.  
  3214.     SYNOPSIS
  3215.         #include "cxlvid.h"
  3216.         int revsattr(int attr);
  3217.  
  3218.     INPUTS
  3219.         attr - text attribute
  3220.  
  3221.     RETURN VALUE
  3222.         The inverted text attribute.
  3223.  
  3224.     ALSO SEE
  3225.         mapattr  revattr
  3226.  
  3227.     EXAMPLE
  3228.         int attr=LMAGENTA|_RED;
  3229.         prints(0,0,attr,"Normal");
  3230.         prints(1,0,revsattr(attr),"Reverse");
  3231.  
  3232.     ------------------------------------------------------------------------
  3233.  
  3234.     NAME
  3235.         scancode
  3236.  
  3237.  
  3238.  
  3239.  
  3240.                                       48
  3241.  
  3242.  
  3243.     DESCRIPTION
  3244.         Returns the common scan code of the specified character.
  3245.  
  3246.     SYNOPSIS
  3247.         #include "cxlkey.h"
  3248.         int scancode(int ch);
  3249.  
  3250.     INPUTS
  3251.         ch - an ASCII character
  3252.  
  3253.     RETURN VALUE
  3254.         The common scan code of the specified character.   The characters
  3255.         '0' thru '9', '*', '-', '+', and '.' will return their scan code
  3256.         from their regular keys, not their numeric keypad keys.
  3257.  
  3258.     ------------------------------------------------------------------------
  3259.  
  3260.     NAME
  3261.         scrndump
  3262.  
  3263.     DESCRIPTION
  3264.         Dumps the current screen to the printer (PRN).
  3265.  
  3266.     SYNOPSIS
  3267.         #include "cxlprn.h"
  3268.         void scrndump(void);
  3269.  
  3270.     ALSO SEE
  3271.         scrntodisk  ssave  videoinit
  3272.  
  3273.     ------------------------------------------------------------------------
  3274.  
  3275.     NAME
  3276.         scrntodisk
  3277.  
  3278.     DESCRIPTION
  3279.         Copies the current screen to a disk file.
  3280.  
  3281.     SYNOPSIS
  3282.         #include "cxlvid.h"
  3283.         int scrntodisk(char *fname);
  3284.  
  3285.     INPUTS
  3286.         fname  - address of the string containing the filename of the file
  3287.                  to write to
  3288.  
  3289.     RETURN VALUE
  3290.         Nonzero if an error occurred.
  3291.  
  3292.     ALSO SEE
  3293.         disktoscrn  scrndump  ssave  wintodisk
  3294.  
  3295.     ------------------------------------------------------------------------
  3296.  
  3297.  
  3298.  
  3299.  
  3300.                                       49
  3301.  
  3302.  
  3303.     NAME
  3304.         setattr
  3305.  
  3306.     DESCRIPTION
  3307.         Sets the attribute of the character under the current cursor
  3308.         location, and continues for the specified number of characters.
  3309.         Uses video BIOS calls.
  3310.  
  3311.     SYNOPSIS
  3312.         #include "cxlvid.h"
  3313.         void setattr(int attr,int count);
  3314.  
  3315.     INPUTS
  3316.         attr  - attribute to set character
  3317.         count - the number of characters to set the attribute of
  3318.  
  3319.     ALSO SEE
  3320.         attrib  readchat  revattr
  3321.  
  3322.     EXAMPLE
  3323.         prints(0,0,LCYAN|_BLUE,"Hello, world");
  3324.         gotoxy_(0,0);
  3325.         setattr(LMAGENTA|_RED,5);
  3326.  
  3327.     ------------------------------------------------------------------------
  3328.  
  3329.     NAME
  3330.         setcursz
  3331.  
  3332.     DESCRIPTION
  3333.         Sets the cursor size.  This function is video adapter dependent.
  3334.  
  3335.     SYNOPSIS
  3336.         #include "cxlvid.h"
  3337.         void setcursz(int sline,int eline);
  3338.  
  3339.     INPUTS
  3340.         sline - start line of cursor, 32 = no cursor
  3341.         eline - end line of cursor
  3342.  
  3343.     ALSO SEE
  3344.         getcursz  hidecur  lgcursor  showcur  smcursor
  3345.  
  3346.     EXAMPLE
  3347.         setcursz(1,7);  /* sets cursor to large block on color displays */
  3348.  
  3349.     ------------------------------------------------------------------------
  3350.  
  3351.     NAME
  3352.         setkbloop
  3353.  
  3354.     DESCRIPTION
  3355.         Most of the time your program is idle, it is waiting for a keypress.
  3356.         This function allows you to set up a function that will be called
  3357.  
  3358.  
  3359.  
  3360.                                       50
  3361.  
  3362.  
  3363.         while waiting for a keypress.  For example, you could update a
  3364.         status line, or update a time clock continuously while waiting for a
  3365.         keypress.
  3366.  
  3367.     SYNOPSIS
  3368.         #include "cxlkey.h"
  3369.         void setkbloop(void (*func)(void));
  3370.  
  3371.     INPUTS
  3372.         func - address of the function to be called while waiting for
  3373.                keypress or NULL to cancel the procedure.
  3374.  
  3375.     ALSO SEE
  3376.         waitkey  waitkeyt
  3377.  
  3378.     ------------------------------------------------------------------------
  3379.  
  3380.     NAME
  3381.         setlines
  3382.  
  3383.     DESCRIPTION
  3384.         Sets the number of lines on the display.  The videoinit() function
  3385.         must have previously been called.
  3386.  
  3387.     SYNOPSIS
  3388.         #include "cxlvid.h"
  3389.         int setlines(int numlines);
  3390.  
  3391.     INPUTS
  3392.         numlines - the number of lines to set the display to. Valid numbers
  3393.                    are:
  3394.                        25 - all video adapters
  3395.                        43 - EGA
  3396.                        50 - VGA
  3397.  
  3398.      RETURN VALUE
  3399.          Nonzero if an error occurred.
  3400.  
  3401.      ALSO SEE
  3402.          mode  videoinit  vidtype
  3403.  
  3404.     EXAMPLE
  3405.         printf("%s\n",setlines(43)?"You do not have an EGA card":
  3406.                "You are now in EGA 43-line mode");
  3407.  
  3408.     ------------------------------------------------------------------------
  3409.  
  3410.     NAME
  3411.         setonkey
  3412.  
  3413.     DESCRIPTION
  3414.         Attaches/detaches a keypress to a function call.  Works by
  3415.         intercepting any calls to CXL keyboard input functions.  Whenever
  3416.         you use one of CXL's keyboard input functions, the input function
  3417.  
  3418.  
  3419.  
  3420.                                       51
  3421.  
  3422.  
  3423.         will check to see if the pressed key has been defined.  If so, then
  3424.         the input function will call the corresponding function.  If not,
  3425.         then the input function will pass on the keypress as normal.
  3426.  
  3427.     SYNOPSIS
  3428.         #include "cxlkey.h"
  3429.         int setonkey(unsigned keycode,void (*func) (void),unsigned pass);
  3430.  
  3431.     INPUTS
  3432.         keycode - keycode of key to define. If the keycode was previously
  3433.                   defined, it will be re-defined.  See Appendix B for a list
  3434.                   of keycodes.
  3435.         func    - address of the function to call upon keypress.  If NULL is
  3436.                   specified for func, then the specified keycode will be
  3437.                   un-defined.
  3438.         pass    - keycode of key to pass back to caller after the onkey
  3439.                   function returns.  This allows you to have one keypress
  3440.                   return the code for another.  If pass==0, then the key
  3441.                   will not be passed back, and execution will resume where
  3442.                   the interruption occurred.
  3443.  
  3444.     RETURN VALUE
  3445.         Nonzero if a memory allocation error occurred.
  3446.  
  3447.     ALSO SEE
  3448.         setkbloop
  3449.  
  3450.     EXAMPLE
  3451.         setonkey(0x011b,escape_routine,0);
  3452.  
  3453.     ------------------------------------------------------------------------
  3454.  
  3455.     NAME
  3456.         showcur
  3457.  
  3458.     DESCRIPTION
  3459.         Reveals the hidden cursor, restoring it to its previous shape.
  3460.  
  3461.     SYNOPSIS
  3462.         #include "cxlvid.h"
  3463.         void showcur(void);
  3464.  
  3465.     ALSO SEE
  3466.         hidecur  lgcursor  setcursz  smcursor
  3467.  
  3468.     ------------------------------------------------------------------------
  3469.  
  3470.     NAME
  3471.         smcursor
  3472.  
  3473.     DESCRIPTION
  3474.         Makes the cursor small.
  3475.  
  3476.     SYNOPSIS
  3477.  
  3478.  
  3479.  
  3480.                                       52
  3481.  
  3482.  
  3483.         #include "cxlvid.h"
  3484.         void smcursor(void);
  3485.  
  3486.     ALSO SEE
  3487.         hidecur  lgcursor  setcursz  showcur
  3488.  
  3489.     ------------------------------------------------------------------------
  3490.  
  3491.     NAME
  3492.         sound_
  3493.  
  3494.     DESCRIPTION
  3495.         Sounds a tone of specified pitch and duration.
  3496.  
  3497.     SYNOPSIS
  3498.         #include "cxldef.h"
  3499.         void sound_(unsigned pitch,unsigned duration);
  3500.  
  3501.     INPUTS
  3502.         pitch    - pitch of tone (0-65535)
  3503.         duration - duration of tone (0-65535).  ie. 182 = 10 seconds
  3504.  
  3505.     ALSO SEE
  3506.         beep
  3507.  
  3508.     EXAMPLE
  3509.         sound_(5000,36);    /* sounds a tone for 2 seconds */
  3510.  
  3511.     ------------------------------------------------------------------------
  3512.  
  3513.     NAME
  3514.         spc
  3515.  
  3516.     DESCRIPTION
  3517.         Displays a specified number of spaces to the screen using the text
  3518.         attribute of the character under the cursor.
  3519.  
  3520.     SYNOPSIS
  3521.         #include "cxlvid.h"
  3522.         void spc(int num);
  3523.  
  3524.     INPUTS
  3525.         num - number of spaces to display
  3526.  
  3527.     ------------------------------------------------------------------------
  3528.  
  3529.     NAME
  3530.         srestore
  3531.  
  3532.     DESCRIPTION
  3533.         Restores a previously saved screen, and frees the memory allocated
  3534.         by ssave().
  3535.  
  3536.     SYNOPSIS
  3537.  
  3538.  
  3539.  
  3540.                                       53
  3541.  
  3542.  
  3543.         #include "cxlvid.h"
  3544.         void srestore(int *sbuf);
  3545.  
  3546.     INPUTS
  3547.         sbuf - address of previously saved screen buffer
  3548.  
  3549.     ALSO SEE
  3550.         ssave
  3551.  
  3552.     ------------------------------------------------------------------------
  3553.  
  3554.     NAME
  3555.         ssave
  3556.  
  3557.     DESCRIPTION
  3558.         Saves the current screen to a buffer.  To work with monochrome video
  3559.         adapters, videoinit() must have previously been called.
  3560.  
  3561.     SYNOPSIS
  3562.         #include "cxlvid.h"
  3563.         int *ssave(void);
  3564.  
  3565.     RETURN VALUE
  3566.         Address of newly created screen buffer or NULL if a memory
  3567.         allocation error occurred.
  3568.  
  3569.     ALSO SEE
  3570.         scrntodisk  srestore  videoinit  wsave
  3571.  
  3572.     EXAMPLE
  3573.         int *p;
  3574.         if((p=ssave())==NULL) {
  3575.             printf("Memory allocation error\n");
  3576.             exit(1);
  3577.         }
  3578.  
  3579.     ------------------------------------------------------------------------
  3580.  
  3581.     NAME
  3582.         strblank
  3583.  
  3584.     DESCRIPTION
  3585.         Determines if a given string is blank (whitespace).
  3586.  
  3587.     SYNOPSIS
  3588.         #include "cxlstr.h"
  3589.         int strblank(char *str);
  3590.  
  3591.     INPUTS
  3592.         str - address of the string to check
  3593.  
  3594.     RETURN VALUE
  3595.         A zero if the string is not blank, otherwise it is.
  3596.  
  3597.  
  3598.  
  3599.  
  3600.                                       54
  3601.  
  3602.  
  3603.     EXAMPLE
  3604.         char string1[]="  Hello  ";
  3605.         char string2[]=" \n  \t \r ";
  3606.         printf("string1 is %sblank\n",strblank(string1)?"":"not ");
  3607.         printf("string2 is %sblank\n",strblank(string2)?"":"not ");
  3608.  
  3609.     ------------------------------------------------------------------------
  3610.  
  3611.     NAME
  3612.         strbmatch
  3613.  
  3614.     DESCRIPTION
  3615.         Returns the best match of a string in an array of strings.
  3616.  
  3617.     SYNOPSIS
  3618.         #include "cxlstr.h"
  3619.         char *strbmatch(char *str,char *strarr[]);
  3620.  
  3621.     INPUTS
  3622.         str    - address of string to match
  3623.         strarr - address of array of string pointers.  The last pointer in
  3624.                  the array must be NULL.
  3625.  
  3626.     RETURN VALUE
  3627.         Address of the string in the array that best matched the given
  3628.         string.
  3629.  
  3630.     ALSO SEE
  3631.         strmatch
  3632.  
  3633.     EXAMPLE
  3634.         char *strings[]= { "Hello","There","Computer","World",NULL };
  3635.         char str1[]="xhelpx";
  3636.         printf("<%s> best matches <%s>\n",str1,strbmatch(str1,strings));
  3637.  
  3638.     ------------------------------------------------------------------------
  3639.  
  3640.     NAME
  3641.         strchg
  3642.  
  3643.     DESCRIPTION
  3644.         Finds all letters in a string matching one character and replaces
  3645.         them with another.
  3646.  
  3647.     SYNOPSIS
  3648.         #include "cxlstr.h"
  3649.         int strchg(char *str,int oldch,int newch);
  3650.  
  3651.     INPUTS
  3652.         str   - address of string to search
  3653.         oldch - character to search for
  3654.         newch - character to replace with
  3655.  
  3656.     RETURN VALUE
  3657.  
  3658.  
  3659.  
  3660.                                       55
  3661.  
  3662.  
  3663.         The number of matches found.
  3664.  
  3665.     ALSO SEE
  3666.         strichg
  3667.  
  3668.     EXAMPLE
  3669.         char str[]="Hello, world";
  3670.         printf("Before:  %s\n",str);
  3671.         strchg(str,'l','z');
  3672.         printf("After:   %s\n",str);
  3673.  
  3674.     ------------------------------------------------------------------------
  3675.  
  3676.     NAME
  3677.         strchksum
  3678.  
  3679.     DESCRIPTION
  3680.         Returns the checksum of a string.  The checksum is calculated by
  3681.         adding up the ASCII values of each character in the string.
  3682.  
  3683.     SYNOPSIS
  3684.         #include "cxlstr.h"
  3685.         unsigned long strchksum(char *str);
  3686.  
  3687.     INPUTS
  3688.         str - address of the string
  3689.  
  3690.     RETURN VALUE
  3691.         The checksum of the input string.
  3692.  
  3693.     ALSO SEE
  3694.         strichksum
  3695.  
  3696.     EXAMPLE
  3697.         printf("The checksum of <Hello> is %lu\n",strchksum("Hello"));
  3698.  
  3699.     ------------------------------------------------------------------------
  3700.  
  3701.     NAME
  3702.         strcode
  3703.  
  3704.     DESCRIPTION
  3705.         Encrypts/decrypts a string.  Call this function to encrypt a string,
  3706.         then call again using the same key to decrypt it.  When reading or
  3707.         writing from a disk file, be sure to open the file in binary mode.
  3708.  
  3709.     SYNOPSIS
  3710.         #include "cxlstr.h"
  3711.         char *strcode(char *str,char *key);
  3712.  
  3713.     INPUTS
  3714.         str - the address of the string to encrypt/decrypt
  3715.         key - the address of the key string to encrypt/decrypt with. The
  3716.               string can consist of any valid characters (01-FF) and can be
  3717.  
  3718.  
  3719.  
  3720.                                       56
  3721.  
  3722.  
  3723.               of any length.  Remember this key or your data will be lost
  3724.               forever!
  3725.  
  3726.     RETURN VALUE
  3727.         The address of the encrypted/decrypted string.
  3728.  
  3729.     ALSO SEE
  3730.         fcrypt
  3731.  
  3732.     EXAMPLE
  3733.         char str[]="Hello, world";
  3734.         printf("Before:     %s\n",str);
  3735.         strcode(str,"34&*#Mdq");
  3736.         printf("Encrypted:  %s\n",str);
  3737.         strcode(str,"34&*#Mdq");
  3738.         printf("Decrypted:  %s\n",str);
  3739.  
  3740.     ------------------------------------------------------------------------
  3741.  
  3742.     NAME
  3743.         strdel
  3744.  
  3745.     DESCRIPTION
  3746.         Deletes a substring from within a string.
  3747.  
  3748.     SYNOPSIS
  3749.         #include "cxlstr.h"
  3750.         char *strdel(char *substr,char *str);
  3751.  
  3752.     INPUTS
  3753.         substr - address of substring to delete
  3754.         str    - address of string to delete substring from
  3755.  
  3756.     RETURN VALUE
  3757.         A NULL if the substring was not found, or the address of the
  3758.         modified string.
  3759.  
  3760.     ALSO SEE
  3761.         stridel  strinc  strins  strmid
  3762.  
  3763.     EXAMPLE
  3764.         char str[]="Hello there, world";
  3765.         printf("Before:  %s\n",str);
  3766.         strdel(" there",str);
  3767.         printf("After:   %s\n",str);
  3768.  
  3769.     ------------------------------------------------------------------------
  3770.  
  3771.     NAME
  3772.         strichg
  3773.  
  3774.     DESCRIPTION
  3775.         Finds all letters in a string matching one character and replaces
  3776.         them with another.  Ignores case of letters.
  3777.  
  3778.  
  3779.  
  3780.                                       57
  3781.  
  3782.  
  3783.     SYNOPSIS
  3784.         #include "cxlstr.h"
  3785.         int strichg(char *str,int oldch,int newch);
  3786.  
  3787.     INPUTS
  3788.         str    - address of string to search
  3789.         oldch  - character to search for
  3790.         newch  - character to replace oldch with
  3791.  
  3792.     RETURN VALUE
  3793.         The number of matches found.
  3794.  
  3795.     ALSO SEE
  3796.         strchg
  3797.  
  3798.     EXAMPLE
  3799.         char str[]="HelLo, worLd";
  3800.         printf("Before:  %s\n",str);
  3801.         strichg(str,'l','l');
  3802.         printf("After:   %s\n",str);
  3803.  
  3804.     ------------------------------------------------------------------------
  3805.  
  3806.     NAME
  3807.         strichksum
  3808.  
  3809.     DESCRIPTION
  3810.         Returns the checksum of a string.  The checksum is calculated by
  3811.         adding up the ASCII values of each character in the string.  All
  3812.         lowercase letters will be counted as uppercase.
  3813.  
  3814.     SYNOPSIS
  3815.         #include "cxlstr.h"
  3816.         unsigned long strichksum(char *str);
  3817.  
  3818.     INPUTS
  3819.         str - address of the string
  3820.  
  3821.     RETURN VALUE
  3822.         The checksum of the input string.
  3823.  
  3824.     ALSO SEE
  3825.         strchksum
  3826.  
  3827.     EXAMPLE
  3828.         printf("The checksum of <Hello> is %lu\n",strichksum("Hello"));
  3829.  
  3830.     ------------------------------------------------------------------------
  3831.  
  3832.     NAME
  3833.         stridel
  3834.  
  3835.     DESCRIPTION
  3836.         Deletes a substring from within a string.  Ignores case of letters.
  3837.  
  3838.  
  3839.  
  3840.                                       58
  3841.  
  3842.  
  3843.     SYNOPSIS
  3844.         #include "cxlstr.h"
  3845.         char *stridel(char *substr,char *str);
  3846.  
  3847.     INPUTS
  3848.         substr - address of substring to delete
  3849.         str    - address of string to delete substring from
  3850.  
  3851.     RETURN VALUE
  3852.         A NULL if the substring was not found, or the address of the
  3853.         modified string.
  3854.  
  3855.     ALSO SEE
  3856.         strdel  striinc
  3857.  
  3858.     EXAMPLE
  3859.         char str[]="Hello tHeRe, world";
  3860.         printf("Before:  %s\n",str);
  3861.         stridel(" ThErE",str);
  3862.         printf("After:   %s\n",str);
  3863.  
  3864.     ------------------------------------------------------------------------
  3865.  
  3866.     NAME
  3867.         striinc
  3868.  
  3869.     DESCRIPTION
  3870.         Determines if and where one string is included within another.
  3871.         Ignores case of letters.
  3872.  
  3873.     SYNOPSIS
  3874.         #include "cxlstr.h"
  3875.         char *striinc(char *str1,char *str2);
  3876.  
  3877.     INPUTS
  3878.         str1 - address of the string to search for
  3879.         str2 - address of the string to search
  3880.  
  3881.     RETURN VALUE
  3882.         The address where string1 is included in string2, or a NULL if
  3883.         string1 is not included in string2.
  3884.  
  3885.     ALSO SEE
  3886.         strinc  strmid
  3887.  
  3888.     EXAMPLE
  3889.         char str[]="Hello, world";
  3890.         printf("<ElLo> is %sincluded in <%s>\n"
  3891.             ,striinc("ElLo",str)==NULL?"not ":"",str);
  3892.  
  3893.     ------------------------------------------------------------------------
  3894.  
  3895.     NAME
  3896.         strinc
  3897.  
  3898.  
  3899.  
  3900.                                       59
  3901.  
  3902.  
  3903.     DESCRIPTION
  3904.         Determines if and where one string is included within another.
  3905.  
  3906.     SYNOPSIS
  3907.         #include "cxlstr.h"
  3908.         char *strinc(char *str1,char *str2);
  3909.  
  3910.     INPUTS
  3911.         str1 - address of the string to search for
  3912.         str2 - address of the string to search
  3913.  
  3914.     RETURN VALUE
  3915.         The address where string1 is included in string2, or a NULL if
  3916.         string1 is not included in string2.
  3917.  
  3918.     ALSO SEE
  3919.         striinc  strmid
  3920.  
  3921.     EXAMPLE
  3922.         char str[]="Hello, world";
  3923.         printf("<ElLo> is %sincluded in <%s>\n"
  3924.             ,strinc("ElLo",str)==NULL?"not ":"",str);
  3925.  
  3926.     ------------------------------------------------------------------------
  3927.  
  3928.     NAME
  3929.         strins
  3930.  
  3931.     DESCRIPTION
  3932.         Inserts one string into another.
  3933.  
  3934.     SYNOPSIS
  3935.         #include "cxlstr.h"
  3936.         char *strins(char *instr,char *str,int st_pos);
  3937.  
  3938.     INPUTS
  3939.         instr  - the address of the string to insert
  3940.         str    - the address of the string to insert instr into.  This area
  3941.                  must be large enough to hold the size of the modified
  3942.                  string.
  3943.         st_pos - the starting position of where to insert
  3944.  
  3945.     RETURN VALUE
  3946.         The address of the modified string.
  3947.  
  3948.     ALSO SEE
  3949.         strdel  strinc
  3950.  
  3951.     EXAMPLE
  3952.         char str[20]="Hello, world";
  3953.         printf("Before:  %s\n",str);
  3954.         strins(" there",str,5);
  3955.         printf("After:   %s\n",str);
  3956.  
  3957.  
  3958.  
  3959.  
  3960.                                       60
  3961.  
  3962.  
  3963.     ------------------------------------------------------------------------
  3964.  
  3965.     NAME
  3966.         striocc
  3967.  
  3968.     DESCRIPTION
  3969.         Returns the number of occurrences of a character in a string.
  3970.         Ignores case of letters.
  3971.  
  3972.     SYNOPSIS
  3973.         #include "cxlstr.h"
  3974.         int striocc(char *str,int ch);
  3975.  
  3976.     INPUTS
  3977.         str - address of the string to search
  3978.         ch  - the character to look for
  3979.  
  3980.     RETURN VALUE
  3981.         The number of occurrences of the character in the string.
  3982.  
  3983.     ALSO SEE
  3984.         strocc
  3985.  
  3986.     EXAMPLE
  3987.         char str[]="HelLo, world";
  3988.         printf("There are %d occurrences of '%c' in <%s>\n"
  3989.             ,striocc(str,'l'),'l',str);
  3990.  
  3991.     ------------------------------------------------------------------------
  3992.  
  3993.     NAME
  3994.         strisocc
  3995.  
  3996.     DESCRIPTION
  3997.         Counts occurrences of one string within another.  Ignores case of
  3998.         letters.
  3999.  
  4000.     SYNOPSIS
  4001.         #include "cxlstr.h"
  4002.         int strisocc(char *str1,char *str2);
  4003.  
  4004.     INPUTS
  4005.         str1 - address of string to search for
  4006.         str2 - address of string to search
  4007.  
  4008.     RETURN VALUE
  4009.         The number of times that string str1 occurs in string str2.
  4010.  
  4011.     ALSO SEE
  4012.         strsocc
  4013.  
  4014.     EXAMPLE
  4015.         char str1[]="hello";
  4016.         char str2[]="Hello1HELLO2HeLlO3hElLo";
  4017.  
  4018.  
  4019.  
  4020.                                       61
  4021.  
  4022.  
  4023.         printf("<%s> occurs in <%s> %d times\n",str1,str2
  4024.             ,strisocc(str1,str2));
  4025.  
  4026.     ------------------------------------------------------------------------
  4027.  
  4028.     NAME
  4029.         strisrep
  4030.  
  4031.     DESCRIPTION
  4032.         Searches for, and replaces one string within another. Ignores case
  4033.         of letters.
  4034.  
  4035.     SYNOPSIS
  4036.         #include "cxlstr.h"
  4037.         char *strisrep(char *str,char *search,char *replace);
  4038.  
  4039.     INPUTS
  4040.         str     - address of string to search.  This must have enough space
  4041.                   to hold the modified string.
  4042.         search  - address of string to search for
  4043.         replace - address of string to replace search string with
  4044.  
  4045.     RETURN VALUE
  4046.         The address of the modified string, or NULL if the search string
  4047.         wasn't found.
  4048.  
  4049.     ALSO SEE
  4050.         strsrep
  4051.  
  4052.     EXAMPLE
  4053.         char str[24]="This is a big string";
  4054.         printf("Before:  %s\n",str);
  4055.         strisrep(str,"StR","th");
  4056.         printf("After:   %s\n",str);
  4057.  
  4058.     ------------------------------------------------------------------------
  4059.  
  4060.     NAME
  4061.         strleft
  4062.  
  4063.     DESCRIPTION
  4064.         Takes a specified portion of a string from its left and creates a
  4065.         new string.
  4066.  
  4067.     SYNOPSIS
  4068.         #include "cxlstr.h"
  4069.         char *strleft(char *str,int num_chars);
  4070.  
  4071.     INPUTS
  4072.         str        - address of input string
  4073.         num_chars  - number of characters to copy
  4074.  
  4075.     RETURN VALUE
  4076.         Address of the newly created string or a NULL if a memory allocation
  4077.  
  4078.  
  4079.  
  4080.                                       62
  4081.  
  4082.  
  4083.         error occurred.  Be sure to free() this string if or when you don't
  4084.         need it anymore.
  4085.  
  4086.     ALSO SEE
  4087.         strmid  strright  strtrim
  4088.  
  4089.     EXAMPLE
  4090.         char *p,str[]="Hello, world";
  4091.         printf("%s\n",p=strleft(str,5));
  4092.         free(p);
  4093.  
  4094.     ------------------------------------------------------------------------
  4095.  
  4096.     NAME
  4097.         strljust
  4098.  
  4099.     DESCRIPTION
  4100.         Left justifies a text string.
  4101.  
  4102.     SYNOPSIS
  4103.         #include "cxlstr.h"
  4104.         char *strljust(char *str);
  4105.  
  4106.     INPUTS
  4107.         str - address of the string to left justify
  4108.  
  4109.     RETURN VALUE
  4110.         Address of the modified string.
  4111.  
  4112.     ALSO SEE
  4113.         strrjust
  4114.  
  4115.     EXAMPLE
  4116.         char str[]="     Hello, world";
  4117.         printf("Before:  <%s>\n",str);
  4118.         strljust(str);
  4119.         printf("After:   <%s>\n",str);
  4120.  
  4121.     ------------------------------------------------------------------------
  4122.  
  4123.     NAME
  4124.         strltrim
  4125.  
  4126.     DESCRIPTION
  4127.         Trims the leading spaces off of a string.
  4128.  
  4129.     SYNOPSIS
  4130.         #include "cxlstr.h"
  4131.         char *strltrim(char *str);
  4132.  
  4133.     INPUTS
  4134.         str - address of the string to trim
  4135.  
  4136.     RETURN VALUE
  4137.  
  4138.  
  4139.  
  4140.                                       63
  4141.  
  4142.  
  4143.         Address of the modified string.
  4144.  
  4145.     ALSO SEE
  4146.         strright  strsetsz  strtrim
  4147.  
  4148.     EXAMPLE
  4149.         char str[]="     Hello, world";
  4150.         printf("Before:  <%s>\n",str);
  4151.         strltrim(str);
  4152.         printf("After:   <%s>\n",str);
  4153.  
  4154.     ------------------------------------------------------------------------
  4155.  
  4156.     NAME
  4157.         strmatch
  4158.  
  4159.     DESCRIPTION
  4160.         Compares 2 strings and returns a match score.
  4161.  
  4162.     SYNOPSIS
  4163.         #include "cxlstr.h"
  4164.         int strmatch(char *str1,char *str2);
  4165.  
  4166.     INPUTS
  4167.         str1 - address of first string
  4168.         str2 - address of second string
  4169.  
  4170.     RETURN VALUE
  4171.         A match score.  The higher the score, the better they match.
  4172.  
  4173.     ALSO SEE
  4174.         strbmatch
  4175.  
  4176.     ------------------------------------------------------------------------
  4177.  
  4178.     NAME
  4179.         strmid
  4180.  
  4181.     DESCRIPTION
  4182.         Takes a section from input string starting at given position and
  4183.         taking the given amount of characters creating a new string.
  4184.  
  4185.     SYNOPSIS
  4186.         #include "cxlstr.h"
  4187.         char *strmid(char *str,int st_pos,int num_chars);
  4188.  
  4189.     INPUTS
  4190.         str       - address of input string
  4191.         st_pos    - position in input string to start copying characters
  4192.                     (starting at position 0)
  4193.         num_chars - number of characters to copy
  4194.  
  4195.     RETURN VALUE
  4196.         Address of the newly created string or a NULL if a memory allocation
  4197.  
  4198.  
  4199.  
  4200.                                       64
  4201.  
  4202.  
  4203.         error occurred.  Be sure to free() the string when or if you are
  4204.         finished with it.
  4205.  
  4206.     ALSO SEE
  4207.         strleft  strright
  4208.  
  4209.     EXAMPLE
  4210.         char *p,str[]="Hello there, world";
  4211.         printf("%s\n",p=strmid(str,6,5));
  4212.         free(p);
  4213.  
  4214.     ------------------------------------------------------------------------
  4215.  
  4216.     NAME
  4217.         strocc
  4218.  
  4219.     DESCRIPTION
  4220.         Returns the number of occurrences of a given character in a string.
  4221.  
  4222.     SYNOPSIS
  4223.         #include "cxlstr.h"
  4224.         int strocc(char *str,int ch);
  4225.  
  4226.     INPUTS
  4227.         str - address of the string to search
  4228.         ch  - the character to look for
  4229.  
  4230.     RETURN VALUE
  4231.         The number of occurrences of the given character in the string.
  4232.  
  4233.     ALSO SEE
  4234.         striocc
  4235.  
  4236.     EXAMPLE
  4237.         char str[]="Hello, world";
  4238.         printf("There are %d occurrences of '%c' in <%s>\n"
  4239.             ,strocc(str,'l'),'l',str);
  4240.  
  4241.     ------------------------------------------------------------------------
  4242.  
  4243.     NAME
  4244.         strright
  4245.  
  4246.     DESCRIPTION
  4247.         Takes a specifed portion from the right side of a string creating a
  4248.         new string.
  4249.  
  4250.     SYNOPSIS
  4251.         #include <string.h>
  4252.         #include "cxlstr.h"
  4253.         char *strright(char *str,int num_chars);
  4254.  
  4255.     INPUTS
  4256.         str       - address of input string
  4257.  
  4258.  
  4259.  
  4260.                                       65
  4261.  
  4262.  
  4263.         num_chars - number of characters to copy
  4264.  
  4265.     RETURN VALUE
  4266.         Address of the newly created string or a NULL if a memory allocation
  4267.         error occurred.  Be sure to free() the string when or if you are
  4268.         finished with it.
  4269.  
  4270.     ALSO SEE
  4271.         strleft  strltrim  strmid
  4272.  
  4273.     EXAMPLE
  4274.         char *p,str[]="Hello, world";
  4275.         printf("%s\n",p=strright(str,5));
  4276.         free(p);
  4277.  
  4278.     ------------------------------------------------------------------------
  4279.  
  4280.     NAME
  4281.         strrjust
  4282.  
  4283.     DESCRIPTION
  4284.         Right justifies a text string.
  4285.  
  4286.     SYNOPSIS
  4287.         #include "cxlstr.h"
  4288.         char *strrjust(char *str);
  4289.  
  4290.     INPUTS
  4291.         str - address of string to right justify
  4292.  
  4293.     RETURN VALUE
  4294.         Address of modified string.
  4295.  
  4296.     ALSO SEE
  4297.         strljust
  4298.  
  4299.     EXAMPLE
  4300.         char str[]="Hello, world     ";
  4301.         printf("Before:  <%s>\n",str);
  4302.         strrjust(str);
  4303.         printf("After:   <%s>\n",str);
  4304.  
  4305.     ------------------------------------------------------------------------
  4306.  
  4307.     NAME
  4308.         strrol
  4309.  
  4310.     DESCRIPTION
  4311.         Rotates a string specified number of characters left.  The rotated
  4312.         characters wrap around to the right side of the string.
  4313.  
  4314.     SYNOPSIS
  4315.         #include "cxlstr.h"
  4316.         char *strrol(char *str,int count);
  4317.  
  4318.  
  4319.  
  4320.                                       66
  4321.  
  4322.  
  4323.     INPUTS
  4324.         str   - the address of the string to rotate
  4325.         count - number of characters to rotate
  4326.  
  4327.     RETURN VALUE
  4328.         The address of the modified string.
  4329.  
  4330.     ALSO SEE
  4331.         strror  strshl
  4332.  
  4333.     EXAMPLE
  4334.         char str[]="Hello, world";
  4335.         printf("Before:  <%s>\n",str);
  4336.         strrol(str,3);
  4337.         printf("After:   <%s>\n",str);
  4338.  
  4339.     ------------------------------------------------------------------------
  4340.  
  4341.     NAME
  4342.         strror
  4343.  
  4344.     DESCRIPTION
  4345.         Rotates a string specified number of characters right.  The rotated
  4346.         characters wrap around to the left side of the string.
  4347.  
  4348.     SYNOPSIS
  4349.         #include "cxlstr.h"
  4350.         char *strror(char *str,int count);
  4351.  
  4352.     INPUTS
  4353.         str   - the address of the string to rotate
  4354.         count - number of characters to rotate
  4355.  
  4356.     RETURN VALUE
  4357.         The address of the modified string.
  4358.  
  4359.     ALSO SEE
  4360.         strrol  strshr
  4361.  
  4362.     EXAMPLE
  4363.         char str[]="Hello, world";
  4364.         printf("Before:  <%s>\n",str);
  4365.         strror(str,3);
  4366.         printf("After:   <%s>\n",str);
  4367.  
  4368.     ------------------------------------------------------------------------
  4369.  
  4370.     NAME
  4371.         strsetsz
  4372.  
  4373.     DESCRIPTION
  4374.         Adjusts the length of a string, either by truncation or padding with
  4375.         spaces.
  4376.  
  4377.  
  4378.  
  4379.  
  4380.                                       67
  4381.  
  4382.  
  4383.     SYNOPSIS
  4384.         #include "cxlstr.h"
  4385.         char *strsetsz(char *str,int newsize);
  4386.  
  4387.     INPUTS
  4388.         str     - address of the string to modify.  This area must be large
  4389.                   enough to hold the string at its newsize length.
  4390.         newsize - the new length of the string
  4391.  
  4392.     RETURN VALUE
  4393.         The address of the modified string.
  4394.  
  4395.     ALSO SEE
  4396.         strtrim
  4397.  
  4398.     EXAMPLE
  4399.         char str[22]="Hello, world";
  4400.         printf("Before:  <%s>\n",str);
  4401.         strsetsz(str,20);
  4402.         printf("Len=20:  <%s>\n",str);
  4403.         strsetsz(str,5);
  4404.         printf("Len=5:   <%s>\n",str);
  4405.  
  4406.     ------------------------------------------------------------------------
  4407.  
  4408.     NAME
  4409.         strshl
  4410.  
  4411.     DESCRIPTION
  4412.         Shifts a string a specified number of characters left.  Characters
  4413.         that shift past the beginning of the string "drop off" and spaces
  4414.         are added to the right of the string.
  4415.  
  4416.     SYNOPSIS
  4417.         #include "cxlstr.h"
  4418.         char *strshl(char *str,int count);
  4419.  
  4420.     INPUTS
  4421.         str   - the address of the string to shift
  4422.         count - number of characters to shift
  4423.  
  4424.     RETURN VALUE
  4425.         The address of the modifed string.
  4426.  
  4427.     ALSO SEE
  4428.         strrol  strshr
  4429.  
  4430.     EXAMPLE
  4431.         char str[]="Hello, world";
  4432.         printf("Before:  <%s>\n",str);
  4433.         strshl(str,3);
  4434.         printf("After:   <%s>\n",str);
  4435.  
  4436.     ------------------------------------------------------------------------
  4437.  
  4438.  
  4439.  
  4440.                                       68
  4441.  
  4442.  
  4443.     NAME
  4444.         strshr
  4445.  
  4446.     DESCRIPTION
  4447.         Shifts a string a specified number of characters right.  Characters
  4448.         that shift past the end of the string "drop off" and spaces are
  4449.         added to the left of the string.
  4450.  
  4451.     SYNOPSIS
  4452.         #include "cxlstr.h"
  4453.         char *strshr(char *str,int count);
  4454.  
  4455.     INPUTS
  4456.         str   - the address of the string to shift
  4457.         count - number of characters to shift
  4458.  
  4459.     RETURN VALUE
  4460.         The address of the modified string.
  4461.  
  4462.     ALSO SEE
  4463.         strror  strshl
  4464.  
  4465.     EXAMPLE
  4466.         char str[]="Hello, world";
  4467.         printf("Before:  <%s>\n",str);
  4468.         strshr(str,3);
  4469.         printf("After:   <%s>\n",str);
  4470.  
  4471.     ------------------------------------------------------------------------
  4472.  
  4473.     NAME
  4474.         strsocc
  4475.  
  4476.     DESCRIPTION
  4477.         Counts the occurrences of one string within another.
  4478.  
  4479.     SYNOPSIS
  4480.         #include "cxlstr.h"
  4481.         int strsocc(char *str1,char *str2);
  4482.  
  4483.     INPUTS
  4484.         str1 - address of string to search for
  4485.         str2 - address of string to search
  4486.  
  4487.     RETURN VALUE
  4488.         The number of times that string str1 occurs in string str2.
  4489.  
  4490.     ALSO SEE
  4491.         strisocc
  4492.  
  4493.     EXAMPLE
  4494.         char str1[]="hello";
  4495.         char str2[]="Hello1hello2HeLlO3hElLo";
  4496.         printf("<%s> occurs in <%s> %d times\n",str1,str2
  4497.  
  4498.  
  4499.  
  4500.                                       69
  4501.  
  4502.  
  4503.             ,strsocc(str1,str2));
  4504.  
  4505.     ------------------------------------------------------------------------
  4506.  
  4507.     NAME
  4508.         strsrep
  4509.  
  4510.     DESCRIPTION
  4511.         Searches for, and replaces one string within another.
  4512.  
  4513.     SYNOPSIS
  4514.         #include "cxlstr.h"
  4515.         char *strsrep(char *str,char *search,char *replace);
  4516.  
  4517.     INPUTS
  4518.         str     - address of string to search
  4519.         search  - address of string to search for
  4520.         replace - address of string to replace search string with
  4521.  
  4522.     RETURN VALUE
  4523.         The address of the modified string, or NULL if the search string
  4524.         wasn't found.
  4525.  
  4526.     ALSO SEE
  4527.         strisrep
  4528.  
  4529.     EXAMPLE
  4530.         char str[24]="This is a big string";
  4531.         printf("Before:  %s\n",str);
  4532.         strsrep(str,"str","th");
  4533.         printf("After:   %s\n",str);
  4534.  
  4535.     ------------------------------------------------------------------------
  4536.  
  4537.     NAME
  4538.         strtrim
  4539.  
  4540.     DESCRIPTION
  4541.         Trims trailing spaces off of a string.
  4542.  
  4543.     SYNOPSIS
  4544.         #include "cxlstr.h"
  4545.         char *strtrim(char *str);
  4546.  
  4547.     INPUTS
  4548.         str - address of the string to trim
  4549.  
  4550.     RETURN VALUE
  4551.         Address of the modified string.
  4552.  
  4553.     ALSO SEE
  4554.         strleft  strltrim  strsetsz
  4555.  
  4556.     EXAMPLE
  4557.  
  4558.  
  4559.  
  4560.                                       70
  4561.  
  4562.  
  4563.         char str[]="Hello, world     ";
  4564.         printf("Before:  <%s>\n",str);
  4565.         strtrim(str);
  4566.         printf("After:   <%s>\n",str);
  4567.  
  4568.     ------------------------------------------------------------------------
  4569.  
  4570.     NAME
  4571.         struplow
  4572.  
  4573.     DESCRIPTION
  4574.         Converts a string to mixed upper & lowercase characters.
  4575.         Characters are forced to upper or lowercase depending upon the
  4576.         previous character in the string.
  4577.  
  4578.     SYNOPSIS
  4579.         #include "cxlstr.h"
  4580.         char *struplow(char *str);
  4581.  
  4582.     INPUTS
  4583.         str - the address of the string to convert
  4584.  
  4585.     RETURN VALUE
  4586.         The address of the modified string.
  4587.  
  4588.     ALSO SEE
  4589.         touplow
  4590.  
  4591.     EXAMPLE
  4592.         char str[]="hElLo, wOrLd";
  4593.         printf("Before:  <%s>\n",str);
  4594.         struplow(str);
  4595.         printf("After:   <%s>\n",str);
  4596.  
  4597.     ------------------------------------------------------------------------
  4598.  
  4599.     NAME
  4600.         sysdate
  4601.  
  4602.     DESCRIPTION
  4603.         Returns a string containing the current system date.
  4604.  
  4605.     SYNOPSIS
  4606.         #include "cxldef.h"
  4607.         char *sysdate(int dtype);
  4608.  
  4609.     INPUTS
  4610.         dtype  - date type code.  Can be one of the following:
  4611.                     Code     Example
  4612.                     ----     -------
  4613.                      0       December 3, 1988
  4614.                      1       3 Dec 88
  4615.                      2       12-3-88
  4616.                      3       12/3/88
  4617.  
  4618.  
  4619.  
  4620.                                       71
  4621.  
  4622.  
  4623.                      4       3/12/88
  4624.  
  4625.     RETURN VALUE
  4626.         The address of the static string containing the system date.
  4627.  
  4628.     ALSO SEE
  4629.         systime
  4630.  
  4631.     EXAMPLE
  4632.         printf("Today's date is %s\n",sysdate(0));
  4633.  
  4634.     ------------------------------------------------------------------------
  4635.  
  4636.     NAME
  4637.         systime
  4638.  
  4639.     DESCRIPTION
  4640.         Returns a string containing the current system time.
  4641.  
  4642.     SYNOPSIS
  4643.         #include "cxldef.h"
  4644.         char *systime(int ttype);
  4645.  
  4646.     INPUTS
  4647.         ttype - time type code.  Can be one of the following:
  4648.                    Code     Example
  4649.                    ----     -------
  4650.                     0       16:30:57.89
  4651.                     1       16:30:57
  4652.                     2       4:30 PM
  4653.                     3       4:30p
  4654.                     4       4:30
  4655.  
  4656.     RETURN VALUE
  4657.         The address of the static string containing the current system time.
  4658.  
  4659.     ALSO SEE
  4660.         sysdate
  4661.  
  4662.     EXAMPLE
  4663.         printf("The current time is %s\n",systime(2));
  4664.  
  4665.     ------------------------------------------------------------------------
  4666.  
  4667.     NAME
  4668.         tabstop
  4669.  
  4670.     DESCRIPTION
  4671.         Calculates a tab stop from given column and tab width.
  4672.  
  4673.     SYNOPSIS
  4674.         #include "cxldef.h"
  4675.         int tabstop(int col,int tabwidth);
  4676.  
  4677.  
  4678.  
  4679.  
  4680.                                       72
  4681.  
  4682.  
  4683.     INPUTS
  4684.         col      - column
  4685.         tabwidth - tab width
  4686.  
  4687.     RETURN VALUE
  4688.         The next tab stop column.
  4689.  
  4690.     EXAMPLE
  4691.         printf("The next tab stop after column 9 is column %d\n"
  4692.             ,tabstop(9,8));
  4693.  
  4694.     ------------------------------------------------------------------------
  4695.  
  4696.     NAME
  4697.         timer
  4698.  
  4699.     DESCRIPTION
  4700.         Returns the value of the BIOS timer.  This value is incremented by
  4701.         one every 18.2 seconds.
  4702.  
  4703.     SYNOPSIS
  4704.         #include "cxldef.h"
  4705.         unsigned long timer(void);
  4706.  
  4707.     RETURN VALUE
  4708.         Current value of the BIOS timer.
  4709.  
  4710.     ALSO SEE
  4711.         delay_
  4712.  
  4713.     EXAMPLE
  4714.         printf("Time #1:  %lu\n",timer());
  4715.         delay_(36);
  4716.         printf("Time #2:  %lu\n",timer());
  4717.  
  4718.     ------------------------------------------------------------------------
  4719.  
  4720.     NAME
  4721.         touplow
  4722.  
  4723.     DESCRIPTION
  4724.         Converts a character to upper or lowercase depending on previous
  4725.         character.  This function is used internally by other CXL functions.
  4726.  
  4727.     SYNOPSIS
  4728.         #include "cxlstr.h"
  4729.         int touplow(char *str,char *pos,int ch);
  4730.  
  4731.     INPUTS
  4732.         str - address of string
  4733.         pos - address of current position in string
  4734.         ch  - character to convert
  4735.  
  4736.     RETURN VALUE
  4737.  
  4738.  
  4739.  
  4740.                                       73
  4741.  
  4742.  
  4743.         The converted character.
  4744.  
  4745.     ALSO SEE
  4746.         struplow
  4747.  
  4748.     EXAMPLE
  4749.         char ch='w',str[20]="Hello, ";
  4750.         printf("The character '%c' will be appended to <%s> as '%c'\n"
  4751.             ,ch,str,touplow(str,str+7,ch));
  4752.  
  4753.     ------------------------------------------------------------------------
  4754.  
  4755.     NAME
  4756.         videoinit
  4757.  
  4758.     DESCRIPTION
  4759.         Initializes CXL's video system.  By default, all CXL functions
  4760.         performing direct screen writes go to the CGA screen memory at
  4761.         address B800:0000.  If you want these functions to work correctly
  4762.         with a monochrome video adapter or within a DESQview window, you
  4763.         must call this function. This function sets the values in the global
  4764.         structure variable _vinfo.
  4765.  
  4766.     SYNOPSIS
  4767.         #include "cxlvid.h"
  4768.         int videoinit(void);
  4769.  
  4770.     RETURN VALUE
  4771.         Video adapter type.  See the vidtype() description for all the
  4772.         possible return values.
  4773.  
  4774.     ALSO SEE
  4775.         vidtype
  4776.  
  4777.     ------------------------------------------------------------------------
  4778.  
  4779.     NAME
  4780.         vidtype
  4781.  
  4782.     DESCRIPTION
  4783.         Determines the display adapter type.
  4784.  
  4785.     SYNOPSIS
  4786.         #include "cxlvid.h"
  4787.         int vidtype(void);
  4788.  
  4789.     RETURN VALUE
  4790.         Video adapter type.  Will be one of the following values:
  4791.             V_NONE     - no video adapter
  4792.             V_MDA      - Monochrome Display Adapter
  4793.             V_EGAMONO  - Enhanced Graphics Adapter in mono mode
  4794.             V_MCGAMONO - Multi-Color Graphics Array adapter in mono mode
  4795.             V_VGAMONO  - Video Graphics Array adapter in mono mode
  4796.             V_HGC      - Hercules Graphics Card
  4797.  
  4798.  
  4799.  
  4800.                                       74
  4801.  
  4802.  
  4803.             V_HGCPLUS  - Hercules Graphics Card Plus
  4804.             V_INCOLOR  - Hercules InColor Card
  4805.             V_CGA      - Color Graphics Adapter
  4806.             V_EGA      - Enhanced Graphics Adapter
  4807.             V_MCGA     - Multi-Color Graphics Array adapter
  4808.             V_VGA      - Video Graphics Array adapter
  4809.  
  4810.     ALSO SEE
  4811.         mode  videoinit
  4812.  
  4813.     ------------------------------------------------------------------------
  4814.  
  4815.     NAME
  4816.         wactiv
  4817.  
  4818.     DESCRIPTION
  4819.         Activates a previously opened window, bringing it "in front" of all
  4820.         the others.  Many windowing functions can perform their operations
  4821.         only on the active window.  If a window is not active, you will need
  4822.         to activate it before you can use it for these functions.
  4823.  
  4824.     SYNOPSIS
  4825.         #include "cxlwin.h"
  4826.         int wactiv(WINDOW whandle);
  4827.  
  4828.     INPUTS
  4829.         whandle - the window handle of the window to activate
  4830.  
  4831.     RETURN VALUE
  4832.         W_NOERROR  - no error
  4833.         W_NOTFOUND - window handle not found
  4834.         W_NOACTIVE - no open windows
  4835.  
  4836.     ALSO SEE
  4837.         wisactiv  wopen
  4838.  
  4839.     EXAMPLE
  4840.         int w1,w2;
  4841.         w1=wopen(10,10,20,40,0,LCYAN|_BLUE,LCYAN|_BLUE);
  4842.         w2=wopen(0,0,15,35,1,LMAGENTA|_RED,LMAGENTA|_RED);
  4843.         wactiv(w1);
  4844.  
  4845.     ------------------------------------------------------------------------
  4846.  
  4847.     NAME
  4848.         waitkey
  4849.  
  4850.     DESCRIPTION
  4851.         Clears the keyboard buffer and halts program execution until a key
  4852.         is pressed.
  4853.  
  4854.     SYNOPSIS
  4855.         #include "cxlkey.h"
  4856.         int waitkey(void);
  4857.  
  4858.  
  4859.  
  4860.                                       75
  4861.  
  4862.  
  4863.     RETURN VALUE
  4864.         The ASCII value of the key pressed.
  4865.  
  4866.     ALSO SEE
  4867.         clearkeys  getchf  waitkeyt
  4868.  
  4869.     EXAMPLE
  4870.         printf("Press any key to continue....");
  4871.         waitkey();
  4872.  
  4873.     ------------------------------------------------------------------------
  4874.  
  4875.     NAME
  4876.         waitkeyt
  4877.  
  4878.     DESCRIPTION
  4879.         Clears the keyboard buffer and halts program execution until a key
  4880.         is pressed or the specified time limit expires.
  4881.  
  4882.     SYNOPSIS
  4883.         #include "cxlkey.h"
  4884.         int waitkeyt(int duration);
  4885.  
  4886.     INPUTS
  4887.         duration - length of time to wait for keypress (ie. 182 = 10 secs.)
  4888.  
  4889.     RETURN VALUE
  4890.         The ASCII value of the key pressed or a -1 if the time limit
  4891.         expired.
  4892.  
  4893.     ALSO SEE
  4894.         clearkeys  delay_  getchf  waitkey
  4895.  
  4896.     EXAMPLE
  4897.         printf("Press any key to continue....");
  4898.         waitkeyt(91);       /* time out after 5 seconds */
  4899.  
  4900.     ------------------------------------------------------------------------
  4901.  
  4902.     NAME
  4903.         wborder
  4904.  
  4905.     DESCRIPTION
  4906.         Changes the active window's border box type.  If changing to or from
  4907.         a borderless window, the window's effective area will change as
  4908.         well, changing relative coordinates within the window.
  4909.  
  4910.     SYNOPSIS
  4911.         #include "cxlwin.h"
  4912.         int wborder(int btype);
  4913.  
  4914.     INPUTS
  4915.         btype - box type.  Can be one of the following:
  4916.                     0 - single line border
  4917.  
  4918.  
  4919.  
  4920.                                       76
  4921.  
  4922.  
  4923.                     1 - double line border
  4924.                     2 - single horz, double vert line border
  4925.                     3 - double horz, single vert line border
  4926.                     4 - thick line border
  4927.                     5 - no border (uses spaces for border chars)
  4928.  
  4929.     RETURN VALUE
  4930.         W_NOERROR  - no error
  4931.         W_NOACTIVE - no active window
  4932.         W_INVBTYPE - invalid box type
  4933.  
  4934.     ------------------------------------------------------------------------
  4935.  
  4936.     NAME
  4937.         wbox
  4938.  
  4939.     DESCRIPTION
  4940.         "Draws" a text box in the active window.
  4941.  
  4942.     SYNOPSIS
  4943.         #include "cxlwin.h"
  4944.         int wbox(int wsrow,int wscol,int werow,int wecol,int btype,
  4945.                  int attr);
  4946.  
  4947.     INPUTS
  4948.         wsrow - window start row of box
  4949.         wscol - window start column of box
  4950.         werow - window end row of box
  4951.         wecol - window end column of box
  4952.         btype - box type.  Can be one of the following:
  4953.                     0 - single line border
  4954.                     1 - double line border
  4955.                     2 - single horz, double vert line border
  4956.                     3 - double horz, single vert line border
  4957.                     4 - thick line border
  4958.                     5 - no border (uses spaces for border chars)
  4959.         attr  - text attribute to use for box characters
  4960.  
  4961.     RETURN VALUE
  4962.         W_NOERROR  - no error
  4963.         W_NOACTIVE - no active window
  4964.         W_INVCOORD - invalid coordinates
  4965.  
  4966.     ALSO SEE
  4967.         wfill  whline  wvline
  4968.  
  4969.     ------------------------------------------------------------------------
  4970.  
  4971.     NAME
  4972.         wcclear
  4973.  
  4974.     DESCRIPTION
  4975.         Clears the active window using specified text attribute, then homes
  4976.         the cursor.
  4977.  
  4978.  
  4979.  
  4980.                                       77
  4981.  
  4982.  
  4983.     SYNOPSIS
  4984.         #include "cxlwin.h"
  4985.         int wcclear(int attr);
  4986.  
  4987.     INPUTS
  4988.         attr - text attribute to clear window with
  4989.  
  4990.     RETURN VALUE
  4991.         W_NOERROR  - no error
  4992.         W_NOACTIVE - no active window
  4993.  
  4994.     ALSO SEE
  4995.         wclear  wclreol  wclreos  wfillch
  4996.  
  4997.     EXAMPLE
  4998.         wcclear(BLACK|_BLACK);
  4999.  
  5000.     ------------------------------------------------------------------------
  5001.  
  5002.     NAME
  5003.         wcenters
  5004.  
  5005.     DESCRIPTION
  5006.         Displays a string centered in active window.  Does not recognize
  5007.         control characters.  Does not update cursor position.
  5008.  
  5009.     SYNOPSIS
  5010.         #include "cxlwin.h"
  5011.         int wcenters(int wrow,int attr,char *str);
  5012.  
  5013.     INPUTS
  5014.         wrow - window row to center string at
  5015.         attr - text attribute to use for displayed characters
  5016.         str  - address of string to display
  5017.  
  5018.     RETURN VALUE
  5019.         W_NOERROR  - no error
  5020.         W_NOACTIVE - no active window
  5021.         W_INVCOORD - invalid window row
  5022.         W_STRLONG  - string too long to be centered in window
  5023.  
  5024.     ALSO SEE
  5025.         wprints  wrjusts
  5026.  
  5027.     EXAMPLE
  5028.         wcenters(2,YELLOW|_LGREY,"Main Menu");
  5029.  
  5030.     ------------------------------------------------------------------------
  5031.  
  5032.     NAME
  5033.         wchgattr
  5034.  
  5035.     DESCRIPTION
  5036.         Changes the text attribute of the active window.  All text within
  5037.  
  5038.  
  5039.  
  5040.                                       78
  5041.  
  5042.  
  5043.         the window will be changed also.
  5044.  
  5045.     SYNOPSIS
  5046.         #include "cxlwin.h"
  5047.         int wchgattr(int battr,int wattr);
  5048.  
  5049.     INPUTS
  5050.         battr - the attribute to make the window's border
  5051.         wattr - the attribute to make the window
  5052.  
  5053.     RETURN VALUE
  5054.         W_NOERROR  - no error
  5055.         W_NOACTIVE - no active window
  5056.  
  5057.     ALSO SEE
  5058.         wtextattr
  5059.  
  5060.     EXAMPLE
  5061.         wchgattr(LMAGENTA|_RED,LCYAN|_BLUE);
  5062.  
  5063.     ------------------------------------------------------------------------
  5064.  
  5065.     NAME
  5066.         wchkbox
  5067.  
  5068.     DESCRIPTION
  5069.         Determines whether input window box coordinates are valid for use in
  5070.         the active window.
  5071.  
  5072.     SYNOPSIS
  5073.         #include "cxlwin.h"
  5074.         int wchkbox(int wsrow,int wscol,int werow,int wecol);
  5075.  
  5076.     INPUTS
  5077.         wsrow - window start row
  5078.         wscol - window start column
  5079.         werow - window end row
  5080.         wecol - window end column
  5081.  
  5082.     RETURN VALUE
  5083.         Nonzero if input window box coordinates are invalid.
  5084.  
  5085.     ALSO SEE
  5086.         wchkcol  wchkcoord  wchkrow
  5087.  
  5088.     ------------------------------------------------------------------------
  5089.  
  5090.     NAME
  5091.         wchkcol
  5092.  
  5093.     DESCRIPTION
  5094.         Determines whether input window column coordinate is valid for use
  5095.         in the active window.
  5096.  
  5097.  
  5098.  
  5099.  
  5100.                                       79
  5101.  
  5102.  
  5103.     SYNOPSIS
  5104.         #include "cxlwin.h"
  5105.         int wchkcol(int wcol);
  5106.  
  5107.     INPUTS
  5108.         wcol - window column
  5109.  
  5110.     RETURN VALUE
  5111.         Nonzero if input window column coordinate is invalid.
  5112.  
  5113.     ALSO SEE
  5114.         wchkbox  wchkcoord  wchkrow
  5115.  
  5116.     ------------------------------------------------------------------------
  5117.  
  5118.     NAME
  5119.         wchkcoord
  5120.  
  5121.     DESCRIPTION
  5122.         Determines whether input window row,column coordinates are valid for
  5123.         use in the active window.
  5124.  
  5125.     SYNOPSIS
  5126.         #include "cxlwin.h"
  5127.         int wchkcoord(int wrow,int wcol);
  5128.  
  5129.     INPUTS
  5130.         wrow - window row
  5131.         wcol - window column
  5132.  
  5133.     RETURN VALUE
  5134.         Nonzero if input window coordinates are invalid.
  5135.  
  5136.     ALSO SEE
  5137.         wchkbox  wchkcol  wchkrow
  5138.  
  5139.     ------------------------------------------------------------------------
  5140.  
  5141.     NAME
  5142.         wchkrow
  5143.  
  5144.     DESCRIPTION
  5145.         Determines whether input window row is valid for use in the active
  5146.         window.
  5147.  
  5148.     SYNOPSIS
  5149.         #include "cxlwin.h"
  5150.         int wchkrow(int wrow);
  5151.  
  5152.     INPUTS
  5153.         wrow - window row
  5154.  
  5155.     RETURN VALUE
  5156.         Nonzero if input window row is invalid.
  5157.  
  5158.  
  5159.  
  5160.                                       80
  5161.  
  5162.  
  5163.     ALSO SEE
  5164.         wchkbox  wchkcol  wchkcoord
  5165.  
  5166.     ------------------------------------------------------------------------
  5167.  
  5168.     NAME
  5169.         wclear
  5170.  
  5171.     DESCRIPTION
  5172.         Clears the active window, then homes the cursor.
  5173.  
  5174.     SYNOPSIS
  5175.         #include "cxlwin.h"
  5176.         int wclear(void);
  5177.  
  5178.     RETURN VALUE
  5179.         W_NOERROR  - no error
  5180.         W_NOACTIVE - no active window
  5181.  
  5182.     ALSO SEE
  5183.         wcclear  wclreol  wclreos  wfillch
  5184.  
  5185.     ------------------------------------------------------------------------
  5186.  
  5187.     NAME
  5188.         wclose
  5189.  
  5190.     DESCRIPTION
  5191.         Closes the active window.  If the window has a shadow, it will be
  5192.         closed as well.
  5193.  
  5194.     SYNOPSIS
  5195.         #include "cxlwin.h"
  5196.         int wclose(void);
  5197.  
  5198.     RETURN VALUE
  5199.         W_NOERROR  - no error
  5200.         W_NOACTIVE - no active window
  5201.  
  5202.     ALSO SEE
  5203.         wcloseall  wopen
  5204.  
  5205.     ------------------------------------------------------------------------
  5206.  
  5207.     NAME
  5208.         wcloseall
  5209.  
  5210.     DESCRIPTION
  5211.         Closes all open windows.
  5212.  
  5213.     SYNOPSIS
  5214.         #include "cxlwin.h"
  5215.         int wcloseall(void);
  5216.  
  5217.  
  5218.  
  5219.  
  5220.                                       81
  5221.  
  5222.  
  5223.     RETURN VALUE
  5224.         W_NOERROR  - no error
  5225.         W_NOACTIVE - no active window
  5226.  
  5227.     ALSO SEE
  5228.         wclose  wopen
  5229.  
  5230.     ------------------------------------------------------------------------
  5231.  
  5232.     NAME
  5233.         wclreol
  5234.  
  5235.     DESCRIPTION
  5236.         Clears from the cursor to the end of the active window's line.  The
  5237.         cursor's position is not updated.
  5238.  
  5239.     SYNOPSIS
  5240.         #include "cxlwin.h"
  5241.         int wclreol(void);
  5242.  
  5243.     RETURN VALUE
  5244.         W_NOERROR   - no error
  5245.         W_NOACTIVE  - no active window
  5246.  
  5247.     ALSO SEE
  5248.         wclear  wclreos  wfillch
  5249.  
  5250.     ------------------------------------------------------------------------
  5251.  
  5252.     NAME
  5253.         wclreos
  5254.  
  5255.     DESCRIPTION
  5256.         Clears from the cursor to the end of the active window.  The
  5257.         cursor's position is not updated.
  5258.  
  5259.     SYNOPSIS
  5260.         #include "cxlwin.h"
  5261.         int wclreos(void);
  5262.  
  5263.     RETURN VALUE
  5264.         W_NOERROR  - no error
  5265.         W_NOACTIVE - no active window
  5266.  
  5267.     ALSO SEE
  5268.         wclear  wclreol  wfillch
  5269.  
  5270.     ------------------------------------------------------------------------
  5271.  
  5272.     NAME
  5273.         wcopy
  5274.  
  5275.     DESCRIPTION
  5276.         Creates a new window duplicating the active window.  The new window
  5277.  
  5278.  
  5279.  
  5280.                                       82
  5281.  
  5282.  
  5283.         becomes the active window.
  5284.  
  5285.     SYNOPSIS
  5286.         #include "cxlwin.h"
  5287.         WINDOW wcopy(int nsrow,int nscol);
  5288.  
  5289.     INPUTS
  5290.         nsrow - start row of where to place the duplicate window
  5291.         nscol - start column of where to place the duplicate window
  5292.  
  5293.     RETURN VALUE
  5294.         The window handle of the new window.  If an error occurred, a zero
  5295.         will be returned and the global variable _winfo.errno will be set to
  5296.         one of the following values:
  5297.             W_ALLOCERR - memory allocation error
  5298.             W_INVCOORD - invalid coordinates
  5299.  
  5300.     ALSO SEE
  5301.         wactiv  wmove  wopen
  5302.  
  5303.     EXAMPLE
  5304.         wopen(10,10,20,40,0,LCYAN|_BLUE,LCYAN|_BLUE);
  5305.         wcopy(0,0);
  5306.  
  5307.     ------------------------------------------------------------------------
  5308.  
  5309.     NAME
  5310.         wdelline
  5311.  
  5312.     DESCRIPTION
  5313.         Deletes a line from the active window.  Depending upon the input
  5314.         scroll direction, the lines above or below the line to delete will
  5315.         scroll to fill in the deleted line in, and a blank line will be
  5316.         added.  If what you really want to do is clear the line, you may
  5317.         want to use wclreol() instead.
  5318.  
  5319.     SYNOPSIS
  5320.         #include "cxlwin.h"
  5321.         int wdelline(int wrow,int direc);
  5322.  
  5323.     INPUTS
  5324.         wrow  - window row to delete
  5325.         direc - scroll direction.  Can be one of the following:
  5326.                     SUP   - scroll up
  5327.                     SDOWN - scroll down
  5328.  
  5329.     RETURN VALUE
  5330.         W_NOERROR  - no error
  5331.         W_NOACTIVE - no active window
  5332.         W_INVCOORD - invalid window row
  5333.  
  5334.     ALSO SEE
  5335.         wclreol  winsline  wscroll
  5336.  
  5337.  
  5338.  
  5339.  
  5340.                                       83
  5341.  
  5342.  
  5343.     EXAMPLE
  5344.         wdelline(3,SUP);
  5345.  
  5346.     ------------------------------------------------------------------------
  5347.  
  5348.     NAME
  5349.         wdump
  5350.  
  5351.     DESCRIPTION
  5352.         Dumps the active window to the default printer (PRN).
  5353.  
  5354.     SYNOPSIS
  5355.         #include "cxlwin.h"
  5356.         int wdump(void);
  5357.  
  5358.     RETURN VALUE
  5359.         W_NOERROR  - no error
  5360.         W_NOACTIVE - no active window
  5361.  
  5362.     ALSO SEE
  5363.         windump
  5364.  
  5365.     ------------------------------------------------------------------------
  5366.  
  5367.     NAME
  5368.         wdupc
  5369.  
  5370.     DESCRIPTION
  5371.         Displays a character a specified number of times in the active
  5372.         window.  Characters will be displayed in the window's current text
  5373.         attribute. Control characters are recognized.  Cursor position is
  5374.         updated.
  5375.  
  5376.     SYNOPSIS
  5377.         #include "cxlwin.h"
  5378.         int wdupc(int ch,int count);
  5379.  
  5380.     INPUTS
  5381.         ch    - character to be displayed
  5382.         count - number of times to display character
  5383.  
  5384.     RETURN VALUE
  5385.         W_NOERROR  - no error
  5386.         W_NOACTIVE - no active window
  5387.  
  5388.     ALSO SEE
  5389.         wdups  wputc  wtextattr
  5390.  
  5391.     EXAMPLE
  5392.         wdupc('X',5);
  5393.  
  5394.     ------------------------------------------------------------------------
  5395.  
  5396.     NAME
  5397.  
  5398.  
  5399.  
  5400.                                       84
  5401.  
  5402.  
  5403.         wdups
  5404.  
  5405.     DESCRIPTION
  5406.         Displays a string a specified number of times in the active window.
  5407.         Characters will be displayed in the window's current text attribute.
  5408.         Control characters are recognized.  Cursor position is updated.
  5409.  
  5410.     SYNOPSIS
  5411.         #include "cxlwin.h"
  5412.         int wdups(char *str,int count);
  5413.  
  5414.     INPUTS
  5415.         str   - character to be displayed
  5416.         count - number of times to display character
  5417.  
  5418.     RETURN VALUE
  5419.         W_NOERROR  - no error
  5420.         W_NOACTIVE - no active window
  5421.  
  5422.     ALSO SEE
  5423.         wdupc  wputs  wtextattr
  5424.  
  5425.     EXAMPLE
  5426.         wdups("Hello ",3);
  5427.  
  5428.     ------------------------------------------------------------------------
  5429.  
  5430.     NAME
  5431.         werrmsg
  5432.  
  5433.     DESCRIPTION
  5434.         Most of CXL's windowing functions set the global variable
  5435.         _winfo.errno before returning to their caller.  This function,
  5436.         werrmsg(), reads _winfo.errno and returns the literal error message
  5437.         that corresponds to it.  This can be very useful in debugging
  5438.         programs that use CXL's windowing functions.  Check the individual
  5439.         windowing function descriptions to find out which ones actually set
  5440.         _winfo.errno.
  5441.  
  5442.     SYNOPSIS
  5443.         #include "cxlwin.h"
  5444.         char *werrmsg(void);
  5445.  
  5446.     RETURN VALUE
  5447.         The address of the static string containing the error message that
  5448.         corresponds to the window error code in _winfo.errno.
  5449.  
  5450.     ALSO SEE
  5451.         wperror
  5452.  
  5453.     EXAMPLE
  5454.         wgotoxy(255,255);   /* invalid coordinates */
  5455.         printf("Error = %s\n",werrmsg());
  5456.  
  5457.  
  5458.  
  5459.  
  5460.                                       85
  5461.  
  5462.  
  5463.     ------------------------------------------------------------------------
  5464.  
  5465.     NAME
  5466.         wfill
  5467.  
  5468.     DESCRIPTION
  5469.         Fills in a region of active window with a specified character and
  5470.         attribute.
  5471.  
  5472.     SYNOPSIS
  5473.         #include "cxlwin.h"
  5474.         int wfill(int wsrow,int wscol,int werow,int wecol,int ch,int attr);
  5475.  
  5476.     INPUTS
  5477.         wsrow - window start row
  5478.         wscol - window start column
  5479.         werow - window end row
  5480.         wecol - window end column
  5481.         ch    - character to fill with
  5482.         attr  - text attribute to use for fill
  5483.  
  5484.     RETURN VALUE
  5485.         W_NOERROR  - no error
  5486.         W_NOACTIVE - no active window
  5487.         W_INVCOORD - invalid coordinates
  5488.  
  5489.     ALSO SEE
  5490.         wbox
  5491.  
  5492.     EXAMPLE
  5493.         wfill(2,3,5,15,'Z',WHITE|_GREEN);
  5494.  
  5495.     ------------------------------------------------------------------------
  5496.  
  5497.     NAME
  5498.         wfillch
  5499.  
  5500.     DESCRIPTION
  5501.         Specifies which character the windowing system will use for filling
  5502.         windows with.  By default, it is a space (' ').
  5503.  
  5504.     SYNOPSIS
  5505.         #include "cxlwin.h"
  5506.         void wfillch(int ch);
  5507.  
  5508.     INPUTS
  5509.         ch - character to fill with
  5510.  
  5511.     EXAMPLE
  5512.         wfillch('\260');
  5513.  
  5514.     ------------------------------------------------------------------------
  5515.  
  5516.     NAME
  5517.  
  5518.  
  5519.  
  5520.                                       86
  5521.  
  5522.  
  5523.         wfindrec
  5524.  
  5525.     DESCRIPTION
  5526.         Finds the address of a window record using the specified window
  5527.         handle. This is used internally be several CXL functions.
  5528.  
  5529.     SYNOPSIS
  5530.         #include "cxlwin.h"
  5531.         struct _wrec_t *wfindrec(WINDOW whandle);
  5532.  
  5533.     INPUTS
  5534.         whandle - window handle of window record to find
  5535.  
  5536.     RETURN VALUE
  5537.         The address of the found window record, or NULL if no record was
  5538.         found for the given handle.
  5539.  
  5540.     ------------------------------------------------------------------------
  5541.  
  5542.     NAME
  5543.         wgetc
  5544.  
  5545.     DESCRIPTION
  5546.         Gets a character from the keyboard.  Entered character will be
  5547.         echoed to the active window using the window's current text
  5548.         attribute.  Cursor position is updated.
  5549.  
  5550.     SYNOPSIS
  5551.         #include "cxlwin.h"
  5552.         int wgetc(void);
  5553.  
  5554.     RETURN VALUE
  5555.         The ASCII value of the key pressed or a zero if an error occurred.
  5556.         If error, the global variable _winfo.errno will be set to one of the
  5557.         following:
  5558.             W_NOACTIVE - no active window
  5559.  
  5560.     ALSO SEE
  5561.         wgetchf  wscanf  wtextattr
  5562.  
  5563.     ------------------------------------------------------------------------
  5564.  
  5565.     NAME
  5566.         wgetchf
  5567.  
  5568.     DESCRIPTION
  5569.         Gets a character from the keyboard.  Allows input only of characters
  5570.         listed in the string of valid characters.  Entered characters will
  5571.         be echoed to the active window using the text attribute set by the
  5572.         wtextattr() function.  Cursor position is updated.  Escape checking
  5573.         is provided by default. This can be turned off with the wsetesc()
  5574.         function.
  5575.  
  5576.     SYNOPSIS
  5577.  
  5578.  
  5579.  
  5580.                                       87
  5581.  
  5582.  
  5583.         #include "cxlwin.h"
  5584.         int wgetchf(char *valid,int defchar);
  5585.  
  5586.     INPUTS
  5587.         valid   - address of the string containing the valid characters
  5588.         defchar - default selection in case [Enter] is pressed, or a zero
  5589.                   for none
  5590.  
  5591.     RETURN VALUE
  5592.         The ASCII value of the key pressed, or a zero if an error occurred.
  5593.         If error, the global variable _winfo.errno will be set to one of the
  5594.         following:
  5595.             W_NOACTIVE - no active window
  5596.             W_ESCPRESS - [Esc] key was pressed
  5597.  
  5598.     ALSO SEE
  5599.         wgetc  wscanf  wtextattr
  5600.  
  5601.     EXAMPLE
  5602.         int ch;
  5603.         wputs("Quit, are you sure? ");
  5604.         if((ch=wgetchf("YyNn",'N'))==0) wprintf("Error:  %s\n",werrmsg());
  5605.  
  5606.     ------------------------------------------------------------------------
  5607.  
  5608.     NAME
  5609.         wgetns
  5610.  
  5611.     DESCRIPTION
  5612.         Gets a string from the keyboard, limiting the number of characters
  5613.         input to the specified length.  Entered characters will be echoed to
  5614.         the active window using the text attribute set by the wtextattr()
  5615.         function. Cursor position is updated.  Escape checking is provided
  5616.         by default. This can be turned off with the wsetesc() function.
  5617.  
  5618.     SYNOPSIS
  5619.         #include "cxlwin.h"
  5620.         int wgetns(char *str,int maxlen);
  5621.  
  5622.     INPUTS
  5623.         str    - address of the buffer to receive the input string
  5624.         maxlen - the maximum length of the input string
  5625.  
  5626.     RETURN VALUE
  5627.         W_NOERROR  - no error
  5628.         W_NOACTIVE - no active window
  5629.         W_ESCPRESS - [Esc] key was pressed
  5630.  
  5631.     ALSO SEE
  5632.         wgets  winputsf  wscanf  wsetesc  wtextattr
  5633.  
  5634.     EXAMPLE
  5635.         char buf[6];
  5636.         wputs("Enter 5 characters:  ");
  5637.  
  5638.  
  5639.  
  5640.                                       88
  5641.  
  5642.  
  5643.         if(wgetns(buf,5)) wprintf("Error:  %s\n",werrmsg());
  5644.  
  5645.     ------------------------------------------------------------------------
  5646.  
  5647.     NAME
  5648.         wgets
  5649.  
  5650.     DESCRIPTION
  5651.         Gets a string from the keyboard.  Entered characters will be echoed
  5652.         to the active window in the text attribute set by the wtextattr()
  5653.         function. Cursor position is updated.
  5654.  
  5655.     SYNOPSIS
  5656.         #include "cxlwin.h"
  5657.         int wgets(char *str);
  5658.  
  5659.     INPUTS
  5660.         str - the address of the buffer to receive the input string
  5661.  
  5662.     RETURN VALUE
  5663.         W_NOERROR  - no error
  5664.         W_NOACTIVE - no active window
  5665.  
  5666.     ALSO SEE
  5667.         wgetns  winputsf  wscanf  wtextattr
  5668.  
  5669.     EXAMPLE
  5670.         char name[30];
  5671.         wputs("Enter your name:   ");
  5672.         wgets(name);
  5673.  
  5674.     ------------------------------------------------------------------------
  5675.  
  5676.     NAME
  5677.         wgotoxy
  5678.  
  5679.     DESCRIPTION
  5680.         Sets cursor coordinates within the active window.
  5681.  
  5682.     SYNOPSIS
  5683.         #include "cxlwin.h"
  5684.         int wgotoxy(int wrow,int wcol);
  5685.  
  5686.     INPUTS
  5687.         wrow - window row (Y coordinate)
  5688.         wcol - window column (X coordinate)
  5689.  
  5690.     RETURN VALUE
  5691.         W_NOERROR  - no error
  5692.         W_NOACTIVE - no active window
  5693.         W_INVCOORD - invalid coordinates
  5694.  
  5695.     ALSO SEE
  5696.         wpgotoxy  wreadcur
  5697.  
  5698.  
  5699.  
  5700.                                       89
  5701.  
  5702.  
  5703.     ------------------------------------------------------------------------
  5704.  
  5705.     NAME
  5706.         whandle
  5707.  
  5708.     DESCRIPTION
  5709.         Returns the window handle of the active window.
  5710.  
  5711.     SYNOPSIS
  5712.         #include "cxlwin.h"
  5713.         WINDOW whandle(void);
  5714.  
  5715.     RETURN VALUE
  5716.         The handle of the active window or zero if error.  If error, the
  5717.         global variable _winfo.errno will be set to one of the following:
  5718.             W_NOACTIVE - no active window
  5719.  
  5720.     ALSO SEE
  5721.         wactiv  wisactiv
  5722.  
  5723.     ------------------------------------------------------------------------
  5724.  
  5725.     Context-Sensitive Help Functions
  5726.  
  5727.     CXL's context-sensitive help system operates on the principle of a
  5728.     current help category and a help category stack.  Both require some
  5729.     explaining before you begin to use them.
  5730.  
  5731.     The current help category is the one that will be used when the user
  5732.     presses the help key.  It can be set by one of several ways.  The direct
  5733.     way is for you to explicitly set it by calling whelpcat().  There are
  5734.     also indirect ways that the current help category can be set.  Windows,
  5735.     input fields, and menu items each have individual help categories as
  5736.     part of their record.  If you were to activate a window which has its
  5737.     own help category, then that would become the current help category.
  5738.     During the processing of input fields and menus, each time you move to a
  5739.     new field or menu item item, the current help category is set to the
  5740.     whatever the field/item's help category is, even if that category is
  5741.     zero (empty). This means that input forms and menus overwrite what was
  5742.     in the current help category before the form/menu began processing.
  5743.  
  5744.     To keep from losing the current help category during the processing of
  5745.     forms and menus, you need to be able to save the current help category
  5746.     during that period.  This is where the help stack comes into the
  5747.     picture.  To save the current help category, you push it onto the stack
  5748.     with whelpush().  When you need to retrieve it, you pop it back off of
  5749.     the stack using whelpop().  The category popped off of the stack then
  5750.     becomes the current help category.  This help stack is a LIFO (Last In
  5751.     First Out) stack and holds up to 20 help categories.
  5752.  
  5753.     When the help key is pressed by the user, CXL's help processor will
  5754.     search the help file for the current help category.  If the current help
  5755.     category is zero (empty), then the help category off top of the stack
  5756.     will be used.  This is where the help stack comes in handy.  It allows
  5757.  
  5758.  
  5759.  
  5760.                                       90
  5761.  
  5762.  
  5763.     you to have a "backup" help category for menu items and fields that
  5764.     don't have help categories of their own.  Before processing of the form
  5765.     or menu, you simply push the background help category onto the stack.
  5766.  
  5767.     When the help category is found in the help file, the corresponding help
  5768.     text will be displayed on the screen in the help window.  If there is
  5769.     more than 1 page of text, the user can change between pages via the
  5770.     [PgUp]/[PgDn] keys.  If there are cross-reference items, the user can
  5771.     use the arrow keys to move between them, and use [Enter] to select.
  5772.     Pressing [Esc] will exit the help window.
  5773.  
  5774.     Creating help files is quite easy.  You need to have an ASCII editor to
  5775.     create them with.  Your help file can contain several help categories.
  5776.     Here is an example of a couple of defined help categories:
  5777.  
  5778.         *B 1,Help Category 1
  5779.             help text help text help text
  5780.              help text help text help text
  5781.            help text help text help text
  5782.         *P
  5783.            help text help text help text
  5784.              help text help text help text
  5785.            help text help text help text
  5786.         *E
  5787.  
  5788.         *B 2,Help Category 2
  5789.             help text help text help text
  5790.              help text help text help text
  5791.            help text help text help text
  5792.         *P
  5793.            help text help text help text
  5794.              help text help text help text
  5795.            help text help text help text
  5796.            Also see:    ^Help Category 1^
  5797.         *E
  5798.  
  5799.     The "*B" indicator specifies the beginning of a help category.  The
  5800.     format is "*B helpcatnumber,helpcatname".  The help category number is
  5801.     the number of the help category that you set using whelpcat(). The "*P"
  5802.     indicator specifies a page break and is optional.  You may have as many
  5803.     page breaks as you'd like.  The "*E" indicator specifies the end of the
  5804.     help category.  The "*B", "*P", and "*E" indicators must begin in the
  5805.     first column.  These indicators and the help category name are case
  5806.     insensitive (can be in lowercase, upper case, or mixed).
  5807.  
  5808.     In the definition of Help Category 2, you will notice the cross-
  5809.     reference to Help Category 1.  All cross-referencing is done by
  5810.     embedding the cross-reference category name (not number) inside carats
  5811.     (^).  If you need to display a carat inside the help file, use a double
  5812.     carat (^^).
  5813.  
  5814.     Any text contained outside of the "*B" and "*E" will be treated as
  5815.     comments.  If an "*E" is not found, then the end-of-file will be treated
  5816.     as an "*E".
  5817.  
  5818.  
  5819.  
  5820.                                       91
  5821.  
  5822.  
  5823.     Now, you need to "compile" your ASCII help file into an indexed file.
  5824.     There is utility, MAKEINDX.COM, which takes your ASCII help file as
  5825.     input, and outputs an indexed version of of the same file.  This new
  5826.     file is the actual help file that you specify in the whelpdef()
  5827.     function.  Keep the ASCII help file around so you will be able to make
  5828.     modifications.
  5829.  
  5830.     ------------------------------------------------------------------------
  5831.  
  5832.     NAME
  5833.         whelpcat
  5834.  
  5835.     DESCRIPTION
  5836.         Sets the current help category.  If a window is active at the time,
  5837.         it will also set that window's help category.  The help category set
  5838.         by calling this function is what will be used by the help processor
  5839.         for searching the help file for help text.
  5840.  
  5841.     SYNOPSIS
  5842.         #include "cxlwin.h"
  5843.         int whelpcat(int cat);
  5844.  
  5845.     INPUTS
  5846.         cat - help category number
  5847.  
  5848.     RETURN VALUE
  5849.         W_NOERROR  - no error
  5850.         W_NOHLPDEF - no help record defined
  5851.  
  5852.     ALSO SEE
  5853.         whelpclr  whelpdef  whelpop  whelpush
  5854.  
  5855.     ------------------------------------------------------------------------
  5856.  
  5857.     NAME
  5858.         whelpclr
  5859.  
  5860.     DESCRIPTION
  5861.         Clears the help category stack.
  5862.  
  5863.     SYNOPSIS
  5864.         #include "cxlwin.h"
  5865.         int whelpclr(void);
  5866.  
  5867.     RETURN VALUE
  5868.         W_NOERROR  - no error
  5869.         W_NOHLPDEF - no help defined
  5870.  
  5871.     ALSO SEE
  5872.         whelpdef  whelpcat  whelpop  whelpush
  5873.  
  5874.     ------------------------------------------------------------------------
  5875.  
  5876.     NAME
  5877.  
  5878.  
  5879.  
  5880.                                       92
  5881.  
  5882.  
  5883.         whelpdef
  5884.  
  5885.     DESCRIPTION
  5886.         Defines the help file, key, and window colors.  After calling this
  5887.         function, anytime the help key is pressed, the help processor will
  5888.         search the help file for whatever the current help category is.
  5889.  
  5890.     SYNOPSIS
  5891.         #include "cxlwin.h"
  5892.         int whelpdef(char *file,unsigned key,int winattr,int textattr,
  5893.                      int selattr,int barattr,void (*open)(void));
  5894.  
  5895.     INPUTS
  5896.         file     - address of string containing help file name
  5897.         key      - keycode of key to be used for help key.  See Appendix B
  5898.                    for a list of keycodes that you can use.
  5899.         winattr  - attribute of the help window.
  5900.         textattr - attribute of the text in the help window.
  5901.         selattr  - attribute of the cross-reference selection text.
  5902.         barattr  - attribute of the cross-reference selection bar.
  5903.         open     - address of the function to call immediately upon opening
  5904.                    of the help window.  This can be used to call a function
  5905.                    that could add a window shadow, etc.  If you do not need
  5906.                    to use this feature, specify NULL.
  5907.  
  5908.     RETURN VALUE
  5909.         W_NOERROR  - no error
  5910.         W_ALLOCERR - memory allocation error
  5911.  
  5912.     ALSO SEE
  5913.         whelpcat
  5914.  
  5915.     EXAMPLE
  5916.         whelpdef("CXLDEMO.HLP",0x3b00,LCYAN|_BLUE,GREEN|_BLUE,LGREEN|_BLUE
  5917.             ,BLUE|_LGREY,NULL);
  5918.  
  5919.     ------------------------------------------------------------------------
  5920.  
  5921.     NAME
  5922.         whelpop
  5923.  
  5924.     DESCRIPTION
  5925.         Pops the help category off of the top of the stack and makes it the
  5926.         current help category.
  5927.  
  5928.     SYNOPSIS
  5929.         #include "cxlwin.h"
  5930.         int whelpop(void);
  5931.  
  5932.     RETURN VALUE
  5933.         W_NOERROR  - no error
  5934.         W_NOHLPDEF - no defined help, see whelpdef().
  5935.         W_HLPSTKUN - help stack underflow (stack empty).
  5936.  
  5937.  
  5938.  
  5939.  
  5940.                                       93
  5941.  
  5942.  
  5943.     ALSO SEE
  5944.         whelpcat  whelpclr  whelpdef  whelpopc  whelpush  whelpushc
  5945.  
  5946.     ------------------------------------------------------------------------
  5947.  
  5948.     NAME
  5949.         whelpopc
  5950.  
  5951.     DESCRIPTION
  5952.         Pops the help category off of the top of the stack and into the
  5953.         void.  The current help category is not affected.
  5954.  
  5955.     SYNOPSIS
  5956.         #include "cxlwin.h"
  5957.         int whelpopc(void);
  5958.  
  5959.     RETURN VALUE
  5960.         W_NOERROR  - no error
  5961.         W_NOHLPDEF - no defined help, see whelpdef().
  5962.         W_HLPSTKUN - help stack underflow (stack empty).
  5963.  
  5964.     ALSO SEE
  5965.         whelpcat  whelpclr  whelpdef  whelpop  whelpush  whelpushc
  5966.  
  5967.     ------------------------------------------------------------------------
  5968.  
  5969.     NAME
  5970.         whelpush
  5971.  
  5972.     DESCRIPTION
  5973.         Pushes the current help category onto the help category stack.  The
  5974.         stack can hold up to 20 help categories.
  5975.  
  5976.     SYNOPSIS
  5977.         #include "cxlwin.h"
  5978.         int whelpush(void);
  5979.  
  5980.     RETURN VALUE
  5981.         W_NOERROR  - no error
  5982.         W_NOHLPDEF - no defined help.  See whelpdef().
  5983.         W_HLPSTKOV - help stack overflow (stack full).
  5984.  
  5985.     ALSO SEE
  5986.         whelpcat  whelpclr  whelpdef  whelpop  whelpopc  whelpushc
  5987.  
  5988.     ------------------------------------------------------------------------
  5989.  
  5990.     NAME
  5991.         whelpushc
  5992.  
  5993.     DESCRIPTION
  5994.         Pushes the specified help category onto the help category stack.
  5995.         The current help category is not affected.  The stack can hold up to
  5996.         20 help categories.
  5997.  
  5998.  
  5999.  
  6000.                                       94
  6001.  
  6002.  
  6003.     SYNOPSIS
  6004.         #include "cxlwin.h"
  6005.         int whelpushc(int cat);
  6006.  
  6007.     INPUTS
  6008.         cat - help category number to push onto help category stack
  6009.  
  6010.     RETURN VALUE
  6011.         W_NOERROR  - no error
  6012.         W_NOHLPDEF - no defined help.  See whelpdef().
  6013.         W_HLPSTKOV - help stack overflow (stack full).
  6014.  
  6015.     ALSO SEE
  6016.         whelpcat  whelpclr  whelpdef  whelpop  whelpopc  whelpush
  6017.  
  6018.     ------------------------------------------------------------------------
  6019.  
  6020.     NAME
  6021.         whide
  6022.  
  6023.     DESCRIPTION
  6024.         Hides the active window.  The next window becomes active.
  6025.  
  6026.     SYNOPSIS
  6027.         #include "cxlwin.h"
  6028.         int whide(void);
  6029.  
  6030.     RETURN VALUE
  6031.         W_NOERROR  - no error
  6032.         W_ALLOCERR - memory allocation error
  6033.         W_NOACTIVE - no active window
  6034.  
  6035.     ALSO SEE
  6036.         whandle  wunhide
  6037.  
  6038.     ------------------------------------------------------------------------
  6039.  
  6040.     NAME
  6041.         whline
  6042.  
  6043.     DESCRIPTION
  6044.         "Draws" a horizontal text line in active window using characters
  6045.         defined by given box type.  If horizontal line crosses a vertical
  6046.         line of the same box type, an appropriate intersection or corner
  6047.         will be used.
  6048.  
  6049.     SYNOPSIS
  6050.         #include "cxlwin.h"
  6051.         int whline(int wsrow,int wscol,int count,int btype,int attr);
  6052.  
  6053.     INPUTS
  6054.         wsrow - window start row
  6055.         wscol - window start column
  6056.         count - number of line characters to display
  6057.  
  6058.  
  6059.  
  6060.                                       95
  6061.  
  6062.  
  6063.         btype - box type.  Can be one of the following:
  6064.                     0 - single line
  6065.                     1 - double line
  6066.                     2 - single horz, double vert line
  6067.                     3 - double horz, single vert line
  6068.                     4 - thick line
  6069.                     5 - uses spaces for line chars
  6070.         attr  - text attribute to use for the line
  6071.  
  6072.     RETURN VALUE
  6073.         W_NOERROR   - no error
  6074.         W_NOACTIVE  - no active window
  6075.         W_INVCOORD  - text line too long for window
  6076.         W_INVBTYPE  - invalid box type
  6077.  
  6078.     ALSO SEE
  6079.         wvline
  6080.  
  6081.     EXAMPLE
  6082.         whline(1,0,5,LMAGENTA|_BLACK);
  6083.  
  6084.     ------------------------------------------------------------------------
  6085.  
  6086.     NAME
  6087.         windowat
  6088.  
  6089.     DESCRIPTION
  6090.         Returns the handle of the window at given screen row,column
  6091.         coordinates.
  6092.  
  6093.     SYNOPSIS
  6094.         #include "cxlwin.h"
  6095.         WINDOW windowat(int row,int col);
  6096.  
  6097.     INPUTS
  6098.         row - screen row
  6099.         col - screen column
  6100.  
  6101.     RETURN VALUE
  6102.         The window handle of the window found at given coordinates.  If an
  6103.         error occurred, zero will be returned and _winfo.errno will be set
  6104.         to one of the following:
  6105.             W_NOACTIVE - no active window
  6106.             W_NOTFOUND - no window found at given screen coordinates
  6107.  
  6108.     ALSO SEE
  6109.         whandle
  6110.  
  6111.     ------------------------------------------------------------------------
  6112.  
  6113.     NAME
  6114.         windump
  6115.  
  6116.     DESCRIPTION
  6117.  
  6118.  
  6119.  
  6120.                                       96
  6121.  
  6122.  
  6123.         Dumps a screen window to the printer (PRN).
  6124.  
  6125.     SYNOPSIS
  6126.         #include "cxlprn.h"
  6127.         void windump(int srow,int scol,int erow,int ecol);
  6128.  
  6129.     INPUTS
  6130.         srow - start row
  6131.         scol - start column
  6132.         erow - end row
  6133.         ecol - end column
  6134.  
  6135.     ALSO SEE
  6136.         wdump
  6137.  
  6138.     EXAMPLE
  6139.         windump(0,0,9,79);     /* prints top 10 lines of screen */
  6140.  
  6141.     ------------------------------------------------------------------------
  6142.  
  6143.     Multi-Field Input Functions
  6144.  
  6145.     Three functions are needed to process multi-field formatted input from
  6146.     windows:  winpbeg(), winpdef(), and winpread().  The winpbeg() function
  6147.     marks the start of an input form.  The winpdef() function defines an
  6148.     input field and is called for each input field to be defined. The
  6149.     winpread() function marks the end of the input form and processes all
  6150.     defined fields.  The formatted input capabilities are much like those of
  6151.     the inputsf() and winputsf() functions.  The major difference is that
  6152.     with the winpbeg()/winpdef()/winpread() combination, you can edit back
  6153.     and forth between fields before finally accepting the input.
  6154.  
  6155.     For every input field you want to define, you must call winpdef(). This
  6156.     will allocate memory to hold the input record information. The first two
  6157.     parameters, wrow and wcol, specify where in the active window the field
  6158.     will be loaded.
  6159.  
  6160.     The next parameter, str, is the address of the string buffer to receive
  6161.     the input data.  The edited string will be terminated with a '\0'.  This
  6162.     means if your format string is "AAAAA", your receiving field must be
  6163.     string[6] to hold the terminating '\0'.  You can edit numeric
  6164.     information as well. There are 4 conversion functions to convert numbers
  6165.     to/from CXL fields:
  6166.  
  6167.         cvtic() - convert integer to CXL field string
  6168.         cvtci() - convert CXL field string to integer
  6169.         cvtfc() - convert real number to CXL field string
  6170.         cvtcf() - convert CXL field string to real number
  6171.  
  6172.     The next parameter, format, is the input field format string. It
  6173.     controls how each character is input and how large the input field will
  6174.     be.  It consists of 1 or more format characters, and may have displayed
  6175.     text in between any of the format control characters.  You may use
  6176.     spaces in between the format control characters for readability.  Valid
  6177.  
  6178.  
  6179.  
  6180.                                       97
  6181.  
  6182.  
  6183.     format control characters are listed in the "Formatted Keyboard Input
  6184.     Functions" section.  The case of the format control characters must be
  6185.     as shown.  You can also specify a decimal point in the field.  Format
  6186.     strings for winpdef() are just like those of inputsf() and winputsf()
  6187.     except there are no command toggles.
  6188.  
  6189.     The next parameter in the winpdef() function is fconv.  These are
  6190.     similar to the command toggles of inputsf() and winputsf() except that
  6191.     the fconv character applies conversion to the whole field.  Valid fconv
  6192.     characters are:
  6193.  
  6194.             0   - apply no conversion
  6195.             'L' - convert letters to lowercase
  6196.             'M' - convert letters to mixed upper & lowercase
  6197.             'P' - password field (do not echo characters)
  6198.             'U' - convert letters to uppercase
  6199.             '9' - numeric field (right justify, space fill to the left of
  6200.                   the decimal; and left justify, zero fill to the right of
  6201.                   the decimal.
  6202.  
  6203.     After the fconv parameter comes the mode parameter.  This parameter
  6204.     allows you to specify if the input field is going to create new data or
  6205.     update old data.  If the mode parameter is 0, then the input field
  6206.     will be used for entering new data. If the mode parameter is nonzero,
  6207.     then the input field will be used to update the old data contained in
  6208.     the str parameter.  If you specify 2 for mode, the cursor will appear
  6209.     at the end of the line and if an editing key is pressed first, the field
  6210.     will be used for updating, otherwise the field will be used to create
  6211.     new information.  If you do choose to update, then the length of the
  6212.     input str will be adjusted to the field size either by truncation or
  6213.     padding with spaces.
  6214.  
  6215.     The next parameter in the winpdef() function is validate.  This
  6216.     parameter is the address of an optional user validation/modification
  6217.     function.  If no validation function is to be used, then specify NULL.
  6218.     Your user validation/modification function must be declared like:
  6219.  
  6220.         int func(char *str);
  6221.  
  6222.     where str is the address of the input field that will be passed to it.
  6223.     Once your user function has the address of the input field, you can
  6224.     validate and/or modify the input field. Your function can also display
  6225.     an error message, sound a bell, or just about anything. When your
  6226.     function is done, it must return 0 for no error, or the position in the
  6227.     field where the error occurred (starting with 1).
  6228.  
  6229.     The final parameter to winpdef(), help, is the address of the help
  6230.     category string to assign to this menu item.  This is useful if you are
  6231.     using the context-sensitive help system and you want to assign a
  6232.     different help category to each field.  If you do not need to use this
  6233.     feature, specify NULL for this parameter.
  6234.  
  6235.     The winpdef() function will return one of the following values:
  6236.  
  6237.  
  6238.  
  6239.  
  6240.                                       98
  6241.  
  6242.  
  6243.         W_NOERROR  - no error
  6244.         W_NOACTIVE - no active window
  6245.         W_INVCOORD - invalid coordinates
  6246.         W_ALLOCERR - memory allocation error
  6247.         W_NOFRMBEG - no begin of form specified (winpbeg() not called)
  6248.         W_INVFORMT - invalid format string (syntax error)
  6249.  
  6250.     Once you have defined all input fields with winpdef(), you call
  6251.     winpread() to process them.  The user is allowed to move around and edit
  6252.     all of the fields.  The input fields are validated on the fly and after
  6253.     entering the last field.  Valid editing keys are listed in Appendix E.
  6254.  
  6255.     After the winpread() function returns, all fields defined with winpdef()
  6256.     will be cleared.  The receiving strings of all defined fields will now
  6257.     contain the data entered.  If Escape checking was on and [Esc] was
  6258.     pressed, then all receiving strings will contain the values they held
  6259.     before winpread() was called and W_ESCPRESS will be returned.
  6260.  
  6261.     The general structure for defining input fields looks like:
  6262.  
  6263.         winpbeg(...);
  6264.         winpdef(...);
  6265.         winpdef(...);
  6266.         winpdef(...);
  6267.         winpread();
  6268.  
  6269.     ------------------------------------------------------------------------
  6270.  
  6271.     NAME
  6272.         winpbeg
  6273.  
  6274.     DESCRIPTION
  6275.         Marks the beginning of a data input form, and specifies text
  6276.         attributes to be used by the form.
  6277.  
  6278.     SYNOPSIS
  6279.         #include "cxlwin.h"
  6280.         int winpbeg(int fieldattr,int textattr);
  6281.  
  6282.     INPUTS
  6283.         fieldattr - field attribute
  6284.         textattr  - text attribute
  6285.  
  6286.     RETURN VALUE
  6287.         W_NOERROR  - no error
  6288.         W_ALLOCERR - memory allocation error
  6289.         W_NOACTIVE - no active window
  6290.  
  6291.     ALSO SEE
  6292.         winpdef  winpread
  6293.  
  6294.     ------------------------------------------------------------------------
  6295.  
  6296.     NAME
  6297.  
  6298.  
  6299.  
  6300.                                       99
  6301.  
  6302.  
  6303.         winpdef
  6304.  
  6305.     DESCRIPTION
  6306.         Defines a window input field.
  6307.  
  6308.     SYNOPSIS
  6309.         #include "cxlwin.h"
  6310.         int winpdef(int wrow,int wcol,char *str,char *format,int fconv,
  6311.                     int mode,int (*validate) (char *),int help);
  6312.  
  6313.     INPUTS
  6314.         wrow     - start of input, window's row coordinate
  6315.         wcol     - start of input, window's column coordinate
  6316.         str      - address of string buffer to receive input
  6317.         format   - address of field format string.  See Appendix D for valid
  6318.                    format string characters.
  6319.         fconv    - input field conversion character.  Applies conversion to
  6320.                    all characters in the input field. Can be one of the
  6321.                    following:
  6322.                        0   - apply no conversion
  6323.                        'L' - convert letters to lowercase
  6324.                        'M' - convert letters to mixed case
  6325.                        'P' - password field (no echo)
  6326.                        'U' - convert letters to uppercase
  6327.                        '9' - numeric field
  6328.         mode     - field mode
  6329.                        0 - initial data entry
  6330.                        1 - update existing data
  6331.                        2 - conditional update
  6332.         validate - address of your user validation/modification function.
  6333.                    If you do not wish to have a field validation function,
  6334.                    then specify NULL.
  6335.         help     - help category number to be associated with this input
  6336.                    field. Specify 0 if no help category is to be assigned.
  6337.  
  6338.     RETURN VALUE
  6339.         W_NOERROR  - no error
  6340.         W_ALLOCERR - memory allocation error
  6341.         W_NOFRMBEG - no begin of form specified, see winpbeg()
  6342.         W_INVCOORD - invalid coordinates
  6343.         W_INVFORMT - invalid format string
  6344.  
  6345.     ALSO SEE
  6346.         winpbeg  winpread
  6347.  
  6348.     ------------------------------------------------------------------------
  6349.  
  6350.     NAME
  6351.         winpfba
  6352.  
  6353.     DESCRIPTION
  6354.         Assigns "before" and "after" function pointers to the input field
  6355.         just defined.  The call to this function must appear immediately
  6356.         after the call to the winpdef() to which it relates.  During user
  6357.  
  6358.  
  6359.  
  6360.                                      100
  6361.  
  6362.  
  6363.         input, when the user enters the field, the before function gets
  6364.         called.  When the user leaves the validated field, the after
  6365.         function gets called.  This powerful feature allows you to do some
  6366.         pretty advanced stuff with input fields, but must be used very
  6367.         carefully.
  6368.  
  6369.     SYNOPSIS
  6370.         #include "cxlwin.h"
  6371.         int winpfba(void (*before)(void),void (*after)(void));
  6372.  
  6373.     INPUTS
  6374.         before - address of the before function.  If you do not wish to
  6375.                  define a before function, specify NULL.
  6376.         after  - address of the after function.  If you do not wish to
  6377.                  define an after function, specify NULL.
  6378.  
  6379.     RETURN VALUE
  6380.         W_NOERROR  - no error
  6381.         W_NOACTIVE - no active window
  6382.         W_NOFRMBEG - no begin of form defined.  See winpbeg().
  6383.         W_NOINPDEF - no input fields defined.  See winpdef().
  6384.  
  6385.     ALSO SEE
  6386.         winpbeg  winpdef  winpread
  6387.  
  6388.     ------------------------------------------------------------------------
  6389.  
  6390.     NAME
  6391.         winpfcurr
  6392.  
  6393.     DESCRIPTION
  6394.         Returns the address of the current input field's record.  After the
  6395.         call to this function, you may access any of the current input
  6396.         field's elements.  See the definition of struct _field_t in the
  6397.         CXLWIN.H file for all of the elements you may use.  Use caution when
  6398.         updating elements in the field's record.  This function should only
  6399.         be called while the input form to which it relates is being
  6400.         processed.
  6401.  
  6402.     SYNOPSIS
  6403.         #include "cxlwin.h"
  6404.         struct _field_t *winpfcurr(void);
  6405.  
  6406.     RETURN VALUE
  6407.         The address of the current input field's record.  You can access
  6408.         individual elements of the field's record by using this address and
  6409.         the C pointer operator "->".  This function is a macro with no error
  6410.         checking, and will most likely return an invalid value if there
  6411.         isn't an active form.
  6412.  
  6413.     ALSO SEE
  6414.         winpbeg  winpdef  winpffind  winpread
  6415.  
  6416.     EXAMPLE
  6417.  
  6418.  
  6419.  
  6420.                                      101
  6421.  
  6422.  
  6423.         printf("Length of current input field is:  %d\n"
  6424.             ,winpfcurr()->lenfld);
  6425.  
  6426.     ------------------------------------------------------------------------
  6427.  
  6428.     NAME
  6429.         winpffind
  6430.  
  6431.     DESCRIPTION
  6432.         Searches for a defined field whose window coordinates match the
  6433.         input coordinates, then returns the address of the field's record.
  6434.         After the call to this function, you may access any of the found
  6435.         input field's elements.  See the definition of struct _field_t in
  6436.         the CXLWIN.H file for all of the elements you may use.  Use caution
  6437.         when updating elements in the field's record.  This function should
  6438.         only be called during the processing of the input form to which it
  6439.         relates.
  6440.  
  6441.     SYNOPSIS
  6442.         #include "cxlwin.h"
  6443.         struct _field_t *winpffind(int wrow,int wcol);
  6444.  
  6445.     INPUTS
  6446.         wrow - window row of field to search for
  6447.         wcol - window column of field to search for
  6448.  
  6449.     RETURN VALUE
  6450.         The address of the found field's record.  You can access individual
  6451.         elements of the field's record by using this address and the C
  6452.         pointer operator "->".  If an error occurred, then NULL will be
  6453.         returned and _winfo.errno will be set to one of the following
  6454.         values:
  6455.             W_NOACTIVE - no active window
  6456.             W_NOFRMDEF - no form defined.  See winpbeg().
  6457.             W_NOTFOUND - no defined field matches input window coordinates
  6458.  
  6459.     ALSO SEE
  6460.         winpbeg  winpdef  winpfcurr  winpread
  6461.  
  6462.     ------------------------------------------------------------------------
  6463.  
  6464.     NAME
  6465.         winpread
  6466.  
  6467.     DESCRIPTION
  6468.         Marks the end of the defined input form and initiates processing of
  6469.         the defined input fields.  The user is allowed to edit back and
  6470.         forth between the defined fields until the last field is entered.
  6471.         Valid editing keys are listed in Appendix E.
  6472.  
  6473.     SYNOPSIS
  6474.         #include "cxlwin.h"
  6475.         int winpread(void);
  6476.  
  6477.  
  6478.  
  6479.  
  6480.                                      102
  6481.  
  6482.  
  6483.     RETURN VALUE
  6484.         W_NOERROR  - no error
  6485.         W_NOACTIVE - no active window
  6486.         W_ESCPRESS - [Esc] key was pressed (only if Escape checking was on)
  6487.         W_NOINPDEF - no input fields defined
  6488.  
  6489.     ALSO SEE
  6490.         winpdef  wsetesc
  6491.  
  6492.     ------------------------------------------------------------------------
  6493.  
  6494.     NAME
  6495.         winputsf
  6496.  
  6497.     DESCRIPTION
  6498.         Inputs a formatted string from the keyboard.  Typed-in characters
  6499.         will be echoed to the active window in the current text attribute.
  6500.         This function provides an extremely powerful method of accept
  6501.         single-line input from the user.  You can limit input characters to
  6502.         certain characters of a type, such as numbers, insert strings in
  6503.         between typed in characters, create custom prompts, disable [Enter]
  6504.         until the field is filled, and more.  Provides Escape checking.
  6505.         Updates cursor position.
  6506.  
  6507.     SYNOPSIS
  6508.         #include "cxlwin.h"
  6509.         int winputsf(char *str,char *fmt);
  6510.  
  6511.     INPUTS
  6512.         str - address of the allocated space to receive string
  6513.         fmt - address of the format string.  See Appendix D for valid format
  6514.               string characters.
  6515.  
  6516.     RETURN VALUE
  6517.         W_NOERROR  - no error
  6518.         W_NOACTIVE - no active window
  6519.         W_ESCPRESS - [Esc] key was pressed
  6520.         W_INVFORMT - invalid format string
  6521.  
  6522.     ALSO SEE
  6523.         wgetns  wgets  wscanf  wsetesc  wtextattr
  6524.  
  6525.     EXAMPLE
  6526.         char buf[10];
  6527.         if(winputsf(buf,"'Enter phone nr:  '!R--!'('!+!###!-!') '!+!###"
  6528.             "!-!'-'!+!####")) wprintf("Error:  %s\n",werrmsg());
  6529.  
  6530.     ------------------------------------------------------------------------
  6531.  
  6532.     NAME
  6533.         winsline
  6534.  
  6535.     DESCRIPTION
  6536.         Inserts a blank line in the active window.  Depending upon the input
  6537.  
  6538.  
  6539.  
  6540.                                      103
  6541.  
  6542.  
  6543.         scroll direction, lines will shift up or down to make room for the
  6544.         new line.
  6545.  
  6546.     SYNOPSIS
  6547.         #include "cxlwin.h"
  6548.         int winsline(int wrow,int direc);
  6549.  
  6550.     INPUTS
  6551.         wrow  - window row to insert at
  6552.         direc - scroll direction:
  6553.                     SUP   - scroll up
  6554.                     SDOWN - scroll down
  6555.  
  6556.     RETURN VALUE
  6557.         W_NOERROR  - no error
  6558.         W_NOACTIVE - no active window
  6559.         W_INVCOORD - invalid window row
  6560.  
  6561.     ALSO SEE
  6562.         wdelline  wscroll
  6563.  
  6564.     ------------------------------------------------------------------------
  6565.  
  6566.     NAME
  6567.         wintodisk
  6568.  
  6569.     DESCRIPTION
  6570.         Copies a window of the screen to a disk file.
  6571.  
  6572.     SYNOPSIS
  6573.         #include "cxlvid.h"
  6574.         int wintodisk(int srow,int scol,int erow,int ecol,char *fname);
  6575.  
  6576.     INPUTS
  6577.         srow  - start row of window
  6578.         scol  - start column of window
  6579.         erow  - end row of window
  6580.         ecol  - end column of window
  6581.         fname - address of the string containing the filename of the file to
  6582.                 write to
  6583.  
  6584.     RETURN VALUE
  6585.         Nonzero if an error occurred.
  6586.  
  6587.     ALSO SEE
  6588.         disktoscrn  disktowin  scrntodisk
  6589.  
  6590.     EXAMPLE
  6591.         wintodisk(10,10,20,40,"WINDOW.SAV");
  6592.  
  6593.     ------------------------------------------------------------------------
  6594.  
  6595.     NAME
  6596.         wisactiv
  6597.  
  6598.  
  6599.  
  6600.                                      104
  6601.  
  6602.  
  6603.     DESCRIPTION
  6604.         Determines if the specified window is active.
  6605.  
  6606.     SYNOPSIS
  6607.         #include "cxlwin.h"
  6608.         int wisactiv(WINDOW whandle);
  6609.  
  6610.     INPUTS
  6611.         whandle - the window handle of the window to check.
  6612.  
  6613.     RETURN VALUE
  6614.         Nonzero if specified window is active.
  6615.  
  6616.     ALSO SEE
  6617.         wactiv  whandle
  6618.  
  6619.     ------------------------------------------------------------------------
  6620.  
  6621.     Bar Menu Functions
  6622.  
  6623.     To use CXL's menuing system, you must be familiar with the process of
  6624.     defining menus.  There are several functions associated with the
  6625.     defining of menus.  These functions must appear in your source code in a
  6626.     certain order.  Menu structures can be defined as simple as a one-level
  6627.     pop-up menu, or as complex as a multi-level pull-down menu system.  The
  6628.     basic format of all menu structures is:
  6629.  
  6630.         <wmenubeg|wmenubegc>
  6631.             wmenuitem
  6632.                 [wmenuitxt]
  6633.                 [wmenuiba]
  6634.                 [<wmenubeg|wmenubegc>...]
  6635.             [wmenuitem...]
  6636.         wmenuend
  6637.         wmenuget
  6638.  
  6639.     Either wmenubeg() or wmenubegc() is required to mark the start of a
  6640.     menu, wmenuitem() is required to define menu items, wmenuend() is
  6641.     required to mark the end of a menu, and wmenuget() initiates user
  6642.     processing of the entire menu structure.
  6643.  
  6644.     Notice that you can also define entire menus underneath any individual
  6645.     menu item.  This allows you to easily create nested menus to aid in
  6646.     building complex pull-down and multi-layered menuing systems. There is
  6647.     no limit to how deep you can nest sub-menus, with the exception of
  6648.     available memory.
  6649.  
  6650.     When coding multi-level menu systems, it is a good idea to use indenting
  6651.     as shown above to help you distinguish which menu items and menu-ends go
  6652.     with which menu-begins.
  6653.  
  6654.     wmenuitxt() and wmenuiba() are optional functions.  They allow you to
  6655.     add specific features to a menu item.  If either of these 2 functions
  6656.     are used, they must immediately follow the call to wmenuitem() to which
  6657.  
  6658.  
  6659.  
  6660.                                      105
  6661.  
  6662.  
  6663.     they pertain.
  6664.  
  6665.     After you define the menu structure and call wmenuget(), the user is
  6666.     allowed to make a selection.  The following editing keys may be used by
  6667.     the user when processing the menu:
  6668.  
  6669.         LeftArrow   - moves selection bar to item left.
  6670.         RightArrow  - moves selection bar to item right.
  6671.         UpArrow     - moves selection bar to item upwards.
  6672.         DownArrow   - moves selection bar to item downwards.  If the current
  6673.                       menu item has a pull-down menu attached, then it will
  6674.                       be opened for processing.
  6675.         Enter       - selects the item that the selection bar is on.  If
  6676.                       selected item has a sub-menu attached, then processing
  6677.                       of that menu will begin.
  6678.         Home        - moves selection bar to upper-leftmost item.
  6679.         End         - moves selection bar to lower-rightmost item.
  6680.         Esc         - if Escape checking is on, and your are in the root
  6681.                       menu, pressing this cancels input and returns a -1. If
  6682.                       inside a sub-menu, then you will just back up to the
  6683.                       previous menu.
  6684.  
  6685.     You can also quick-select a menu item by pressing its highlighted
  6686.     selection character, unless this feature is disabled.
  6687.  
  6688.     CXL's menuing system also includes built-in mouse support.  If you want
  6689.     to use it, you need to call msinit() somewhere near the beginning of the
  6690.     program.  This will set the mouse support level to MS_KEYS, which allows
  6691.     the mouse to emulate cursor keys.  If you would like a point-and-shoot
  6692.     selection capability where the user moves the mouse cursor around then
  6693.     presses the button to select, you must set the mouse support level to
  6694.     MS_CURS or MS_FULL via mssupport().  In either method of mouse support,
  6695.     the left mouse button is equivalent to the [Enter] key, and the right
  6696.     mouse button is equivalent to the [Esc] key.
  6697.  
  6698.     Each menu item can have a function and/or sub-menu attached to it.  When
  6699.     the user selects the menu item, wmenuget() will first check for an
  6700.     attached sub-menu.  If one exists, it will be processed.  Then
  6701.     wmenuget() will check for a defined select function.  If one exists,
  6702.     then wmenuget() will call it.
  6703.  
  6704.     This gives you two ways to handle a user selection.   The first, as
  6705.     you've seen, is to have a function attached to the menu item.  For
  6706.     example, if the menu item is "(A)dd Record" and it has a select function
  6707.     called add_record(), then it will be called upon selecting that menu
  6708.     item.  The other way to handle a user selection is by using a
  6709.     switch/case to test the return value from wmenuget().  This will only
  6710.     work properly on single-level menus, but sometimes gives you more
  6711.     flexibility.
  6712.  
  6713.     ------------------------------------------------------------------------
  6714.  
  6715.     NAME
  6716.         wmenubeg
  6717.  
  6718.  
  6719.  
  6720.                                      106
  6721.  
  6722.  
  6723.     DESCRIPTION
  6724.         Starts a menu/sub-menu definition and describes the window which the
  6725.         menu will reside in.  This does not actually open any windows or
  6726.         menus, just defines them.  This must be used in conjuction with
  6727.         wmenuitem() and wmenuend().  This is one of the 4 functions that are
  6728.         required to process a menu.
  6729.  
  6730.     SYNOPSIS
  6731.         #include "cxlwin.h"
  6732.         int wmenubeg(int srow,int scol,int erow,int ecol,int btype,
  6733.                      int battr,int wattr,void (*open)(void));
  6734.  
  6735.     INPUTS
  6736.         srow  - screen start row of where menu's window will open
  6737.         scol  - screen start column of where menu's window will open
  6738.         erow  - screen end row of where menu's window will open
  6739.         ecol  - screen end column of where menu's window will open
  6740.         btype - border type.  Can be one of the following:
  6741.                     0 - single line
  6742.                     1 - double line
  6743.                     2 - single horizontal, double vertical line
  6744.                     3 - double horizontal, single vertical line
  6745.                     4 - thick line
  6746.                     5 - no border
  6747.         battr - attribute to be used for the menu window's border.  If
  6748.                 btype==5, then this value will be ignored.
  6749.         wattr - attribute to be used for the menu's window.
  6750.         open  - address of the function to call upon opening of the menu's
  6751.                 window.  If you want to add a title, shadow, etc. to the
  6752.                 menu's window after it opens, this lets you specify which
  6753.                 function to call to perform these tasks.  Specify NULL if
  6754.                 you don't want to use this feature.
  6755.  
  6756.     RETURN VALUE
  6757.         W_NOERROR  - no error
  6758.         W_NOITMDEF - no menu items defined
  6759.         W_ALLOCERR - memory allocation error
  6760.  
  6761.     ALSO SEE
  6762.         wmenubegc  wmenuitem  wmenuend  wmenuget
  6763.  
  6764.     EXAMPLE
  6765.         wmenubeg(2,10,9,18,0,YELLOW,_BLUE,NULL);
  6766.  
  6767.     ------------------------------------------------------------------------
  6768.  
  6769.     NAME
  6770.         wmenubegc
  6771.  
  6772.     DESCRIPTION
  6773.         Starts a menu/sub-menu definition.  This is used in place of
  6774.         wmenubeg(). This function differs from wmenubeg() in that when the
  6775.         user processes the defined menu, the menu will assume whatever the
  6776.         active window is at the time.
  6777.  
  6778.  
  6779.  
  6780.                                      107
  6781.  
  6782.  
  6783.     SYNOPSIS
  6784.         #include "cxlwin.h"
  6785.         int wmenubegc(void);
  6786.  
  6787.     RETURN VALUE
  6788.         W_NOERROR  - no error
  6789.         W_NOITMDEF - no menu items defined
  6790.         W_ALLOCERR - memory allocation error
  6791.  
  6792.     ALSO SEE
  6793.         wmenubeg  wmenuitem  wmenuend  wmenuget
  6794.  
  6795.     ------------------------------------------------------------------------
  6796.  
  6797.     NAME
  6798.         wmenuend
  6799.  
  6800.     DESCRIPTION
  6801.         Ends a menu/sub-menu definition and defines specific
  6802.         features/attributes of that menu.  This is one of the 4 functions
  6803.         that are required to process a menu.
  6804.  
  6805.     SYNOPSIS
  6806.         #include "cxlwin.h"
  6807.         int wmenuend(int taginit,int menutype,int barwidth,int textpos,
  6808.                      int textattr,int scharattr,int noselattr,int barattr);
  6809.  
  6810.     INPUTS
  6811.         taginit   - tag ID of the item that the selection bar will start at.
  6812.                     If an invalid tag ID is given, then the selection bar
  6813.                     will start at the upper-leftmost item.
  6814.         menutype  - a mask which describes how the menu will act.  Two or
  6815.                     more menutypes can be combined using the bitwise OR
  6816.                     operator '|'. For example, if the menu you are defining
  6817.                     is to be a pull-down menu, and you want to disable quick
  6818.                     selection, then you would specify M_PD|M_NOQS.  Valid
  6819.                     menutypes are:
  6820.                         M_HORZ - horizontal menu
  6821.                         M_VERT - vertical menu
  6822.                         M_OMNI - omnidirectional menu
  6823.                         M_PD   - pull-down menu
  6824.                         M_SAVE - save last bar position
  6825.                         M_NOQS - disable quick selection
  6826.         barwidth  - width of the selection bar.  If zero is given, then the
  6827.                     selection bar will conform to the width of each menu
  6828.                     item. If a number greater than the width of the window
  6829.                     is given, then the barwidth will be adjusted to its
  6830.                     width.
  6831.         textpos   - offset position from the start of the selection bar that
  6832.                     the menu item text will start.  If barwidth==0, then
  6833.                     textpos is ignored.
  6834.         textattr  - attribute to be used for menu text
  6835.         scharattr - attribute to be used for the quick selection character
  6836.         noselattr - attribute to be used for nonselectable text
  6837.  
  6838.  
  6839.  
  6840.                                      108
  6841.  
  6842.  
  6843.         barattr   - attribute to be used for the selection bar
  6844.  
  6845.     RETURN VALUE
  6846.         W_NOERROR  - no error
  6847.         W_NOITMDEF - no menu items defined
  6848.  
  6849.     ALSO SEE
  6850.         wmenubeg  wmenubegc  wmenuget  wmenuitem
  6851.  
  6852.     EXAMPLE
  6853.         wmenuend('F',M_VERT,20,2,YELLOW|_BLUE,LCYAN|_BLUE,LGREY|_BLUE
  6854.             ,BLUE|_LGREY);
  6855.  
  6856.     ------------------------------------------------------------------------
  6857.  
  6858.     NAME
  6859.         wmenuget
  6860.  
  6861.     DESCRIPTION
  6862.         Processes the defined menu structure.  The user is allowed to move a
  6863.         selection bar around to the various menu items. If mouse support is
  6864.         on, then the user can use the mouse for selecting as well.  If
  6865.         sub-menus exists, then the user can select those also.  Escape
  6866.         checking is provided for when the user is in the root menu, however
  6867.         if the user is in a sub-menu, pressing [Esc] will always return to
  6868.         the next level up.  This is one of the 4 functions that are required
  6869.         to process a menu.
  6870.  
  6871.     SYNOPSIS
  6872.         #include "cxlwin.h"
  6873.         int wmenuget(void);
  6874.  
  6875.     RETURN VALUE
  6876.         The tag ID of the menu item that was selected in the root menu.  If
  6877.         an error occurred, then -1 will be returned and the global variable
  6878.         _winfo.errno will be set to one of the following:
  6879.             W_NOMNUDEF - no menu defined
  6880.             W_NOMNUEND - no end of menu specified. See wmenuend().
  6881.             W_ESCPRESS - the [Esc] key was pressed from the root menu
  6882.             W_ALLOCERR - memory allocation error
  6883.             W_INVCOORD - invalid coordinates
  6884.             W_INVBTYPE - invalid box type
  6885.  
  6886.     ALSO SEE
  6887.         wmenubeg  wmenubegc  wmenuend  wmenuitem  wsetesc
  6888.  
  6889.     ------------------------------------------------------------------------
  6890.  
  6891.     NAME
  6892.         wmenuiba
  6893.  
  6894.     DESCRIPTION
  6895.         Assigns "before" and "after" function pointers to the menu item just
  6896.         defined.  The call to this function must appear immediately after
  6897.  
  6898.  
  6899.  
  6900.                                      109
  6901.  
  6902.  
  6903.         the call to the wmenuitem() to which it relates.  During the
  6904.         processing of the menu, when the user moves to the item, the before
  6905.         function gets called.  When the user leaves the item, the after
  6906.         function gets called. This powerful feature allows you to do some
  6907.         advanced stuff with menus, but must be used very carefully.  One
  6908.         possible use of wmenuiba() is to define a before function that opens
  6909.         a window and writes some text in it, and an after function which
  6910.         closes that window.  When the user moved to that menu item, the
  6911.         window would open up and display text, then when the user left that
  6912.         menu item, the window would automatically close.
  6913.  
  6914.     SYNOPSIS
  6915.         #include "cxlwin.h"
  6916.         int wmenuiba(void (*before)(void),void (*after)(void));
  6917.  
  6918.     INPUTS
  6919.         before - address of the before function.  If you do not wish to
  6920.                  define a before function, specify NULL.
  6921.         after  - address of the after function.  If you do not wish to
  6922.                  define an after function, specify NULL.
  6923.  
  6924.     RETURN VALUE
  6925.         W_NOERROR  - no error
  6926.         W_NOITMDEF - no menu items defined.  See wmenuitem().
  6927.  
  6928.     ALSO SEE
  6929.         wmenubeg  wmenuend  wmenuget  wmenuitem  wmenuitxt
  6930.  
  6931.     ------------------------------------------------------------------------
  6932.  
  6933.     NAME
  6934.         wmenuicurr
  6935.  
  6936.     DESCRIPTION
  6937.         Returns the address of the current menu item's record. After this
  6938.         call, you may access any of the item's elements.  This would most
  6939.         likely be used in a function called by a menu item.  See the struct
  6940.         _item_t definition in the CXLWIN.H file for all the elements you may
  6941.         use.
  6942.  
  6943.     SYNOPSIS
  6944.         #include "cxlwin.h"
  6945.         struct _item_t *wmenuicurr(void);
  6946.  
  6947.     RETURN VALUE
  6948.         The address of the current menu item's record.
  6949.  
  6950.     ALSO SEE
  6951.         wmenubeg  wmenuend  wmenuget  wmenuifind  wmenuitem  wmenumcurr
  6952.  
  6953.     EXAMPLE
  6954.         printf("The current menu item's tagid = %d\n",wmenuicurr()->tagid);
  6955.  
  6956.     ------------------------------------------------------------------------
  6957.  
  6958.  
  6959.  
  6960.                                      110
  6961.  
  6962.  
  6963.     NAME
  6964.         wmenuifind
  6965.  
  6966.     DESCRIPTION
  6967.         Searches the menu tree structure for the record of the menu item
  6968.         matching the input tag identifier, then returns the found record's
  6969.         address.  After the call to this function, you may access any of the
  6970.         found menu item's elements.  See the definition of struct _item_t in
  6971.         the CXLWIN.H file for all of the elements you may use.  Use caution
  6972.         when updating elements in the menu item's record.  This function
  6973.         should only be called during the processing of the menu to which it
  6974.         relates.
  6975.  
  6976.     SYNOPSIS
  6977.         #include "cxlwin.h"
  6978.         struct _item_t *wmenuifind(int tagid);
  6979.  
  6980.     INPUTS
  6981.         tagid - the tag identifier of the menu item to find
  6982.  
  6983.     RETURN VALUE
  6984.         The address of the found menu item's record.  You can access
  6985.         individual elements of the menu item's record by using this address
  6986.         and the C pointer operator "->".  If an error occurred, then NULL
  6987.         will be returned and _winfo.errno will be set to one of the
  6988.         following values:
  6989.             W_NOMNUDEF - no menu is defined.  See wmenubeg().
  6990.             W_NOTFOUND - input tag identifier not found
  6991.  
  6992.     ALSO SEE
  6993.         wmenubeg  wmenuend  wmenuget  wmenuicurr  wmenuitem
  6994.  
  6995.     ------------------------------------------------------------------------
  6996.  
  6997.     NAME
  6998.         wmenuitem
  6999.  
  7000.     DESCRIPTION
  7001.         Defines a menu item.  This is one of the 4 functions that are
  7002.         required to process a menu.
  7003.  
  7004.     SYNOPSIS
  7005.         #include "cxlwin.h"
  7006.         int wmenuitem(int wrow,int wcol,char *str,int schar,int tagid,
  7007.                       int fmask,void (*select)(void),unsigned hotkey,
  7008.                       int help);
  7009.  
  7010.     INPUTS
  7011.         wrow   - window row
  7012.         wcol   - window column
  7013.         str    - address of menu item string
  7014.         schar  - quick selection character
  7015.         tagid  - unique tag identifier of this particular menu item.  This
  7016.                  is the value that wmenuget() returns upon its selection.
  7017.  
  7018.  
  7019.  
  7020.                                      111
  7021.  
  7022.  
  7023.         fmask  - feature mask.  Allows you to define one or more additional
  7024.                  features for this menu item.  Valid features are:
  7025.                      M_HASPD - has a pull-down menu attached
  7026.                      M_NOSEL - menu item is not selectable
  7027.                      M_CLOSE - close this menu when item is selected
  7028.                      M_CLALL - close all menus when item is selected
  7029.                  More than one feature can be specified by using the C
  7030.                  bitwise OR operator '|'.  For example, if this item has a
  7031.                  pull-down menu attached and it is not selectable, you would
  7032.                  specify (M_HASPD|M_NOSEL). Specify 0 if you don't want to
  7033.                  define an fmask for this item.
  7034.         select - address of the function to call upon selection of this menu
  7035.                  item.  Specify NULL if you don't want to define a select
  7036.                  function.
  7037.         hotkey - keycode of the key, which when pressed, will select this
  7038.                  menu item's function from anywhere within the menu
  7039.                  structure.  This allows the user to call this menu item's
  7040.                  select function even if not currently processing its menu.
  7041.                  See Appendix B for a list of keycodes that you can use.
  7042.                  Specify 0 if you don't want to define a hotkey.
  7043.         help   - help category number to be associated with this item.
  7044.                  Specify 0 is you don't want to define a help category for
  7045.                  this item.
  7046.  
  7047.     RETURN VALUE
  7048.         W_NOERROR  - no error
  7049.         W_NOMNUBEG - no begin of menu specified.  See wmenubeg().
  7050.         W_ALLOCERR - memory allocation error
  7051.  
  7052.     ALSO SEE
  7053.         wmenubeg  wmenubegc  wmenuend  wmenuget  wmenuicurr  wmenuitxt
  7054.  
  7055.     EXAMPLE
  7056.         wmenuitem(0,0,"Load   F3",'L',1,M_CLOSE,load_file,0x3d00,0);
  7057.  
  7058.     ------------------------------------------------------------------------
  7059.  
  7060.     NAME
  7061.         wmenuitxt
  7062.  
  7063.     DESCRIPTION
  7064.         Adds a text description to a menu item.  You can use this function
  7065.         to create Lotus-style menus where the text descriptions are
  7066.         displayed underneath the menu and change each time the user moves to
  7067.         a new menu item.
  7068.  
  7069.     SYNOPSIS
  7070.         #include "cxlwin.h"
  7071.         int wmenuitxt(int wrow,int wcol,int attr,char *str);
  7072.  
  7073.     INPUTS
  7074.         wrow - window row
  7075.         wcol - window column
  7076.         attr - text attribute
  7077.  
  7078.  
  7079.  
  7080.                                      112
  7081.  
  7082.  
  7083.         str  - address of description string
  7084.  
  7085.     RETURN VALUE
  7086.         W_NOERROR  - no error
  7087.         W_NOITMDEF - no menu items defined
  7088.  
  7089.     ALSO SEE
  7090.         wmenuiba  wmenuitem
  7091.  
  7092.     EXAMPLE
  7093.         wmenuitxt(1,0,LCYAN|_BLUE,"Quit program and return to DOS");
  7094.  
  7095.     ------------------------------------------------------------------------
  7096.  
  7097.     NAME
  7098.         wmenumcurr
  7099.  
  7100.     DESCRIPTION
  7101.         Returns the address of the currently active menu's record.  After
  7102.         this call, you may access any of the menu's elements.  See the
  7103.         definition of struct _menu_t in the CXLWIN.H file for all of the
  7104.         elements you may use. Use caution when updating elements in the
  7105.         menu's record. This function should only be called while the menu to
  7106.         which it relates is being processed.
  7107.  
  7108.     SYNOPSIS
  7109.         #include "cxlwin.h"
  7110.         struct _menu_t *wmenumcurr(void);
  7111.  
  7112.     RETURN VALUE
  7113.         The address of the current menu's record.  After you get this
  7114.         address, you can access the menu's elements via the C pointer
  7115.         operator "->". There is no error return value - if you call this
  7116.         function while not processing a menu, then you will more than likely
  7117.         get an invalid address.
  7118.  
  7119.     ALSO SEE
  7120.         wmenubeg  wmenuend  wmenuget  wmenuicurr  wmenuitem
  7121.  
  7122.     ------------------------------------------------------------------------
  7123.  
  7124.     NAME
  7125.         wmessage
  7126.  
  7127.     DESCRIPTION
  7128.         Displays text on the top or bottom border of the active window.
  7129.  
  7130.     SYNOPSIS
  7131.         #include "cxlwin.h"
  7132.         int wmessage(char *str,int border,int leftofs,int attr);
  7133.  
  7134.     INPUTS
  7135.         str     - address of message string
  7136.         border  - 0 = top border, 1 = bottom border
  7137.  
  7138.  
  7139.  
  7140.                                      113
  7141.  
  7142.  
  7143.         leftofs - offset from left border to display message at
  7144.         attr    - attribute of message text
  7145.  
  7146.     RETURN VALUE
  7147.         W_NOERROR  - no error
  7148.         W_NOACTIVE - no active window
  7149.         W_STRLONG  - string could not fit in window
  7150.         W_NOBORDER - window has no border
  7151.  
  7152.     ALSO SEE
  7153.         wtitle
  7154.  
  7155.     EXAMPLE
  7156.         wmessage("[ F1=Help ]",1,2,YELLOW|_BLACK);
  7157.  
  7158.     ------------------------------------------------------------------------
  7159.  
  7160.     NAME
  7161.         wmove
  7162.  
  7163.     DESCRIPTION
  7164.         Moves the active window to a new location on the screen.
  7165.  
  7166.     SYNOPSIS
  7167.         #include "cxlwin.h"
  7168.         int wmove(int nsrow,int nscol);
  7169.  
  7170.     INPUTS
  7171.         nsrow - new starting row of window
  7172.         nscol - new starting column of window
  7173.  
  7174.     RETURN VALUE
  7175.         W_NOERROR  - no error
  7176.         W_ALLOCERR - memory allocation error
  7177.         W_NOACTIVE - no active window
  7178.  
  7179.     ALSO SEE
  7180.         wcopy  wsize
  7181.  
  7182.     ------------------------------------------------------------------------
  7183.  
  7184.     NAME
  7185.         wopen
  7186.  
  7187.     DESCRIPTION
  7188.         Opens a screen window and makes it active.  The cursor location will
  7189.         be initialized to window row 0, column 0.  The text attribute will
  7190.         be initialized to the same attribute as the window.  You can open as
  7191.         many windows as memory permits.
  7192.  
  7193.     SYNOPSIS
  7194.         #include "cxlwin.h"
  7195.         WINDOW wopen(int srow,int scol,int erow,int ecol,int btype,
  7196.                      int battr,int wattr);
  7197.  
  7198.  
  7199.  
  7200.                                      114
  7201.  
  7202.  
  7203.     INPUTS
  7204.         srow  - starting row
  7205.         scol  - starting column
  7206.         erow  - ending row
  7207.         ecol  - ending column
  7208.         btype - box type.  Can be one of the following:
  7209.                     0 - single line border
  7210.                     1 - double line border
  7211.                     2 - single horz, double vert line border
  7212.                     3 - double horz, single vert line border
  7213.                     4 - thick line border
  7214.                     5 - no border (uses spaces for border chars).  A
  7215.                         borderless window has a greater effective window
  7216.                         area than a window with a border.
  7217.         battr - attribute of window's border.
  7218.         wattr - attribute of window (and initially the text)
  7219.  
  7220.     RETURN VALUE
  7221.         The window handle of the new window or a zero if an error occurred.
  7222.         If error, the global variable _winfo.errno will be set to one of the
  7223.         following:
  7224.             W_ALLOCERR - memory allocation error
  7225.             W_INVCOORD - invalid coordinates
  7226.             W_INVBTYPE - invalid box type
  7227.  
  7228.     ALSO SEE
  7229.         videoinit  wactiv  wclose  wcloseall  wfillch
  7230.  
  7231.     EXAMPLE
  7232.         wopen(10,10,20,40,0,LCYAN|_BLUE,LGREEN|_BLUE);
  7233.  
  7234.     ------------------------------------------------------------------------
  7235.  
  7236.     NAME
  7237.         wperror
  7238.  
  7239.     DESCRIPTION
  7240.         Opens an error window, displays an error message, sounds a beep,
  7241.         waits for a keypress, then returns to caller.  The error window is
  7242.         opened in the general vicinity of the cursor position.
  7243.  
  7244.     SYNOPSIS
  7245.         #include "cxlwin.h"
  7246.         int wperror(char *message);
  7247.  
  7248.     INPUTS
  7249.         message - address of the string containing the error message
  7250.  
  7251.     RETURN VALUE
  7252.         W_NOERROR  - no error
  7253.         W_ALLOCERR - memory allocation error
  7254.         W_STRLONG  - error message string too long
  7255.  
  7256.     ALSO SEE
  7257.  
  7258.  
  7259.  
  7260.                                      115
  7261.  
  7262.  
  7263.         werrmsg
  7264.  
  7265.     EXAMPLE
  7266.         wperror("Field cannot be blank!");
  7267.  
  7268.     ------------------------------------------------------------------------
  7269.  
  7270.     NAME
  7271.         wpgotoxy
  7272.  
  7273.     DESCRIPTION
  7274.         Sets cursor coordinates within the active window.  If cursor
  7275.         coordinates are out of the window, wpgotoxy() will try to wrap them
  7276.         around to fit in the window.
  7277.  
  7278.     SYNOPSIS
  7279.         #include "cxlwin.h"
  7280.         int wpgotoxy(int wrow,int wcol);
  7281.  
  7282.     INPUTS
  7283.         wrow - window row (Y coordinate)
  7284.         wcol - window column (X coordinate)
  7285.  
  7286.     RETURN VALUE
  7287.         W_NOERROR  - no error
  7288.         W_NOACTIVE - no active window
  7289.         W_INVCOORD - invalid coordinates
  7290.  
  7291.     ALSO SEE
  7292.         wgotoxy  wreadcur
  7293.  
  7294.     ------------------------------------------------------------------------
  7295.  
  7296.     NAME
  7297.         wpickfile
  7298.  
  7299.     DESCRIPTION
  7300.         This function will open up a window and display as many
  7301.         file/directory names in it as it can.  The user can use a selection
  7302.         bar to move through the file/directory names and select one.  If all
  7303.         of the file/directory names cannot fit in the window, scrolling and
  7304.         paging is allowed.  If the user selects a directory, wpickfile()
  7305.         will change to that directory and display the list of
  7306.         files/directories in it.  After the selection is made, wpickfile()
  7307.         will return the complete path name of the selected file.
  7308.  
  7309.     SYNOPSIS
  7310.         #include "cxlwin.h"
  7311.         char *wpickfile(int srow,int scol,int erow,int ecol,int btype,
  7312.                         int bordattr,int winattr,int barattr,int title,
  7313.                         char *filespec,void (*open)(void));
  7314.  
  7315.     INPUTS
  7316.         srow     - start row of pick window
  7317.  
  7318.  
  7319.  
  7320.                                      116
  7321.  
  7322.  
  7323.         scol     - start column of pick window
  7324.         erow     - end row of pick window
  7325.         ecol     - end column of pick window.  If ecol==-1, then the
  7326.                    window's width will conform to that of the longest
  7327.                    matching filename.
  7328.         btype    - window box type (0-5)
  7329.         bordattr - border attribute
  7330.         winattr  - window attribute
  7331.         barattr  - selection bar attribute
  7332.         title    - display filespec title on upper border?  (0=no, 1=yes)
  7333.         filespec - match filespec (ie. "*.*")
  7334.         open     - address of the function to call upon each opening of the
  7335.                    file pick window.  If you do not need to use this
  7336.                    feature, specify NULL.
  7337.  
  7338.     RETURN VALUE
  7339.         The address of the static string containing the full
  7340.         drive:path\filename string of the selected file. If an error
  7341.         occurred, NULL will be returned and _winfo.errno will be set to one
  7342.         of the following:
  7343.             W_ESCPRESS - the [Esc] key was pressed
  7344.             W_ALLOCERR - memory allocation error
  7345.             W_DOSERROR - DOS error (ie. invalid directory)
  7346.             W_INVCOORD - invalid window coordinates
  7347.             W_INVBTYPE - invalid box type
  7348.             W_STRLONG  - window not wide enough to hold largest file name
  7349.             W_NOMATCH  - no files matched input filespec
  7350.  
  7351.     ALSO SEE
  7352.         wpickstr  wsetesc
  7353.  
  7354.     EXAMPLE
  7355.         char *fname;
  7356.         fname=wpickfile(10,10,20,65,0,LCYAN|_BLUE,CYAN|_BLUE,BLUE|_LGREY,1
  7357.             ,"*.*",NULL);
  7358.         printf("You selected:  %s\n",fname);
  7359.  
  7360.     ------------------------------------------------------------------------
  7361.  
  7362.     NAME
  7363.         wpickstr
  7364.  
  7365.     DESCRIPTION
  7366.         This function will open up a window and display as many of the input
  7367.         strings in it as it can.  The user can use a selection bar to move
  7368.         through the strings and select one.  If all of the strings cannot
  7369.         fit in the window, scrolling and paging is allowed. After the
  7370.         selection is made, wpickstr() will return the array subsript of the
  7371.         string that was selected.
  7372.  
  7373.     SYNOPSIS
  7374.         #include "cxlwin.h"
  7375.         int wpickstr(int srow,int scol,int erow,int ecol,int btype,
  7376.                      int bordattr,int winattr,int barattr,char *strarr[],
  7377.  
  7378.  
  7379.  
  7380.                                      117
  7381.  
  7382.  
  7383.                      void (*open)(void));
  7384.  
  7385.     INPUTS
  7386.         srow     - start row of pick window
  7387.         scol     - start column of pick window
  7388.         erow     - end row of pick window
  7389.         ecol     - end column of pick window.  If ecol==-1, then the
  7390.                    window's width will conform to that of the longest string
  7391.                    in the input array.
  7392.         btype    - window box type (0-5)
  7393.         bordattr - border attribute
  7394.         winattr  - window attribute
  7395.         barattr  - selection bar attribute
  7396.         strarr   - address of array of char pointers (strings) to select
  7397.                    from. The last pointer in the array MUST be NULL!
  7398.         open     - address of the function to call upon each opening of the
  7399.                    string pick window.  If you do not need to use this
  7400.                    feature, specify NULL.
  7401.  
  7402.     RETURN VALUE
  7403.         The array subscript of the selected string.  If an error occurred,
  7404.         then -1 will be returned and _winfo.errno will be set to one of the
  7405.         following:
  7406.             W_ESCPRESS - the [Esc] key was pressed
  7407.             W_INVCOORD - invalid window coordinates
  7408.             W_INVBTYPE - invalid box type
  7409.             W_STRLONG  - window not wide enough to hold largest file name
  7410.  
  7411.     ALSO SEE
  7412.         wpickfile  wselstr  wsetesc
  7413.  
  7414.     EXAMPLE
  7415.         int i;
  7416.         char *days[]= { "Sunday","Monday","Tuesday","Wednesday","Thursday",
  7417.             "Friday","Saturday",NULL };
  7418.         i=wpickstr(10,10,14,-1,0,YELLOW,LCYAN|_BLUE,BLUE|_LGREY,days,NULL);
  7419.         if(i!=-1) wprintf("You selected %s\n",days[i]);
  7420.  
  7421.     ------------------------------------------------------------------------
  7422.  
  7423.     NAME
  7424.         wprintc
  7425.  
  7426.     DESCRIPTION
  7427.         Displays a character in the active window.  Control characters are
  7428.         not recognized.  Cursor position is not updated.
  7429.  
  7430.     SYNOPSIS
  7431.         #include "cxlwin.h"
  7432.         int wprintc(int row,int col,int attr,int ch);
  7433.  
  7434.     INPUTS
  7435.         row  - window row to display character at
  7436.         col  - window column to display character at
  7437.  
  7438.  
  7439.  
  7440.                                      118
  7441.  
  7442.  
  7443.         attr - text attribute for character
  7444.         ch   - character
  7445.  
  7446.     RETURN VALUE
  7447.         W_NOERROR  - no error
  7448.         W_NOACTIVE - no active window
  7449.         W_INVCOORD - invalid coordinates
  7450.  
  7451.     ALSO SEE
  7452.         wprints  wputc
  7453.  
  7454.     EXAMPLE
  7455.         wprintc(5,5,BLINK|LRED|_GREEN,'X');
  7456.  
  7457.     ------------------------------------------------------------------------
  7458.  
  7459.     NAME
  7460.         wprintf
  7461.  
  7462.     DESCRIPTION
  7463.         Displays a formatted string to the active window at the current
  7464.         cursor position.  Works like the standard printf() function does.
  7465.         Recognizes control characters.  Characters will be displayed in the
  7466.         attribute set by the wtextattr() function.  Updates cursor position.
  7467.         Also recognizes CXL Escape sequences.  See Appendix C for a list of
  7468.         valid Escape codes.
  7469.  
  7470.     SYNOPSIS
  7471.         #include "cxlwin.h"
  7472.         int wprintf(const char *format,...);
  7473.  
  7474.     INPUTS
  7475.         format - address of the format string.  Refer to the your compiler's
  7476.                  run-time library reference manual for information on valid
  7477.                  format characters.
  7478.         ...    - any additional arguments
  7479.  
  7480.     RETURN VALUE
  7481.         W_NOERROR  - no error
  7482.         W_NOACTIVE - no active window
  7483.  
  7484.     ALSO SEE
  7485.         wputc  wputns  wputs  wtabwidth  wtextattr
  7486.  
  7487.     EXAMPLE
  7488.         int i=32767;
  7489.         double d=3.14159;
  7490.         char ch='X',*str="Hello, world";
  7491.         wprintf("i = %d, d = %f, ch = %c, str = %s\n",i,d,ch,str);
  7492.  
  7493.     ------------------------------------------------------------------------
  7494.  
  7495.     NAME
  7496.         wprints
  7497.  
  7498.  
  7499.  
  7500.                                      119
  7501.  
  7502.  
  7503.     DESCRIPTION
  7504.         Displays a string in the active window.  Control characters are not
  7505.         recognized.  Cursor position is not updated.
  7506.  
  7507.     SYNOPSIS
  7508.         #include "cxlwin.h"
  7509.         int wprints(int wrow,int wcol,int attr,char *str);
  7510.  
  7511.     INPUTS
  7512.         wrow - window row to display string at
  7513.         wcol - window column to display string at
  7514.         attr - text attribute for displayed characters
  7515.         str  - address of string
  7516.  
  7517.     RETURN VALUE
  7518.         W_NOERROR  - no error
  7519.         W_NOACTIVE - no active window
  7520.         W_INVCOORD - invalid coordinates
  7521.         W_STRLONG  - string too long for window
  7522.  
  7523.     ALSO SEE
  7524.         wcenters  wprintsf  wputs  wrjusts  wwprints
  7525.  
  7526.     EXAMPLE
  7527.         wprints(10,15,BLINK|YELLOW|_BROWN,"Hello, world");
  7528.  
  7529.     ------------------------------------------------------------------------
  7530.  
  7531.     NAME
  7532.         wprintsf
  7533.  
  7534.     DESCRIPTION
  7535.         Displays a string to active window using a CXL format string.  If a
  7536.         character in a string doesn't match its format control character, it
  7537.         will be displayed as a '?'.  Control characters are not recognized.
  7538.         Cursor position is not updated.
  7539.  
  7540.     SYNOPSIS
  7541.         #include "cxlwin.h"
  7542.         int wprintsf(int wrow,int wcol,int attr,char *format,char *str);
  7543.  
  7544.     INPUTS
  7545.         wrow   - window row
  7546.         wcol   - window column
  7547.         attr   - text attribute
  7548.         format - address of format string.  Valid format string characters
  7549.                  are listed in Appendix D.
  7550.         str    - address of the string to display.
  7551.  
  7552.     RETURN VALUE
  7553.         W_NOERROR  - no error
  7554.         W_NOACTIVE - no active window
  7555.         W_INVFORMT - invalid format string
  7556.         W_STRLONG  - there were more characters in the display string than
  7557.  
  7558.  
  7559.  
  7560.                                      120
  7561.  
  7562.  
  7563.                      the format string would display.
  7564.  
  7565.     ALSO SEE
  7566.         wprints
  7567.  
  7568.     EXAMPLE
  7569.         char str1[]="5125900460",str2[]="(512) 590-2910";
  7570.         wprintsf(3,5,LGREEN|_GREEN,"'('###') '###'-'####",str1);
  7571.         wprintsf(4,5,LGREEN|_GREEN,"##############",str2);
  7572.  
  7573.     ------------------------------------------------------------------------
  7574.  
  7575.     NAME
  7576.         wputc
  7577.  
  7578.     DESCRIPTION
  7579.         Displays a character in the active window at current cursor position
  7580.         using current text attribute.  Recognizes control characters.
  7581.         Updates cursor position.
  7582.  
  7583.     SYNOPSIS
  7584.         #include "cxlwin.h"
  7585.         int wputc(int ch);
  7586.  
  7587.     INPUTS
  7588.         ch - the character to be displayed
  7589.  
  7590.     RETURN VALUE
  7591.         W_NOERROR  - no error
  7592.         W_NOACTIVE - no active window
  7593.  
  7594.     ALSO SEE
  7595.         wdupc  wprintc  wprintf  wtabwidth  wtextattr
  7596.  
  7597.     ------------------------------------------------------------------------
  7598.  
  7599.     NAME
  7600.         wputns
  7601.  
  7602.     DESCRIPTION
  7603.         Displays a string in the active window at the current cursor
  7604.         location using current text attribute.  The input width will
  7605.         determine how many characters are actually displayed.  Padding with
  7606.         spaces or truncating of output will be used where neccessary.
  7607.         Recognizes control characters. Updates cursor position.
  7608.  
  7609.     SYNOPSIS
  7610.         #include "cxlwin.h"
  7611.         int wputns(char *str,int width);
  7612.  
  7613.     INPUTS
  7614.         str   - address of the string to print
  7615.         width - width to display output string at
  7616.  
  7617.  
  7618.  
  7619.  
  7620.                                      121
  7621.  
  7622.  
  7623.     RETURN VALUE
  7624.         W_NOERROR  - no error
  7625.         W_NOACTIVE - no active window
  7626.  
  7627.     ALSO SEE
  7628.         wprintf  wputs  wtextattr
  7629.  
  7630.     EXAMPLE
  7631.         wputns("Hello, world",5);
  7632.  
  7633.     ------------------------------------------------------------------------
  7634.  
  7635.     NAME
  7636.         wputs
  7637.  
  7638.     DESCRIPTION
  7639.         Displays a string in the active window at the current cursor
  7640.         position using current text attribute.  Recognizes control
  7641.         characters.  Updates cursor position.  Also recognizes CXL Escape
  7642.         sequences.  See Appendix C for a list of valid Escape codes.
  7643.  
  7644.     SYNOPSIS
  7645.         #include "cxlwin.h"
  7646.         int wputs(char *str);
  7647.  
  7648.     INPUTS
  7649.         str - the address of the string to display
  7650.  
  7651.     RETURN VALUE
  7652.         W_NOERROR  - no error
  7653.         W_NOACTIVE - no active window
  7654.  
  7655.     ALSO SEE
  7656.         wprintf  wprints  wputns  wputsw  wtabwidth  wtextattr
  7657.  
  7658.     EXAMPLE
  7659.         wputs("\t\033LHello, \033Lworld!\n\n");
  7660.  
  7661.     ------------------------------------------------------------------------
  7662.  
  7663.     NAME
  7664.         wputsw
  7665.  
  7666.     DESCRIPTION
  7667.         Displays a string in active window at the current cursor position.
  7668.         Words will be wrapped around to the next line if necessary.
  7669.         Characters are displayed in the window's current text attribute.
  7670.         Recognizes control characters.  Updates cursor position. Also
  7671.         recognizes CXL Escape sequences.  See Appendix C for a list of valid
  7672.         Escape codes.
  7673.  
  7674.     SYNOPSIS
  7675.         #include "cxlwin.h"
  7676.         int wputsw(char *str);
  7677.  
  7678.  
  7679.  
  7680.                                      122
  7681.  
  7682.  
  7683.     INPUTS
  7684.         str - the address of the string to display
  7685.  
  7686.     RETURN VALUE
  7687.         W_NOERROR  - no error
  7688.         W_NOACTIVE - no active window
  7689.  
  7690.     ALSO SEE
  7691.         wprintf  wputs  wtextattr
  7692.  
  7693.     EXAMPLE
  7694.         wputsw("This is a very long string that will be wrapped around to "
  7695.                "the next line.");
  7696.  
  7697.     ------------------------------------------------------------------------
  7698.  
  7699.     NAME
  7700.         wreadcur
  7701.  
  7702.     DESCRIPTION
  7703.         Reads the current cursor coordinates of the active window.
  7704.  
  7705.     SYNOPSIS
  7706.         #include "cxlwin.h"
  7707.         int wreadcur(int *wrow,int *wcol);
  7708.  
  7709.     INPUTS
  7710.         wrow - address of integer to receive current window row
  7711.         wcol - address of integer to receive current window column
  7712.  
  7713.     RETURN VALUE
  7714.         W_NOERROR  - no error
  7715.         W_NOACTIVE - no active window
  7716.  
  7717.     ALSO SEE
  7718.         wgotoxy
  7719.  
  7720.     EXAMPLE
  7721.         int wrow,wcol;
  7722.         wreadcur(&wrow,&wcol);
  7723.  
  7724.     ------------------------------------------------------------------------
  7725.  
  7726.     NAME
  7727.         wrestore
  7728.  
  7729.     DESCRIPTION
  7730.         Restores a previously saved region of the screen screen and frees
  7731.         the memory allocated by wsave().
  7732.  
  7733.     SYNOPSIS
  7734.         #include "cxlwin.h"
  7735.         void wrestore(int *wbuf);
  7736.  
  7737.  
  7738.  
  7739.  
  7740.                                      123
  7741.  
  7742.  
  7743.     INPUTS
  7744.         wbuf - address of previously wsave()d window.
  7745.  
  7746.     ALSO SEE
  7747.         srestore  wsave
  7748.  
  7749.     ------------------------------------------------------------------------
  7750.  
  7751.     NAME
  7752.         wrjusts
  7753.  
  7754.     DESCRIPTION
  7755.         Displays a string right justified to specified column in the active
  7756.         window.   Does not recognize control characters.  Does not update
  7757.         cursor position.
  7758.  
  7759.     SYNOPSIS
  7760.         #include "cxlwin.h"
  7761.         int wrjusts(int wrow,int wjcol,int attr,char *str);
  7762.  
  7763.     INPUTS
  7764.         wrow  - window row to display string at
  7765.         wjcol - window column that string will right justify to
  7766.         attr  - text attribute for displayed characters
  7767.         str   - address of string to display
  7768.  
  7769.     RETURN VALUE
  7770.         W_NOERROR  - no error
  7771.         W_NOACTIVE - no active window
  7772.         W_INVCOORD - invalid coordinates
  7773.         W_STRLONG  - string too long to fit in window at specified right
  7774.                      justification column.
  7775.  
  7776.     ALSO SEE
  7777.         wcenters  wprints
  7778.  
  7779.     ------------------------------------------------------------------------
  7780.  
  7781.     NAME
  7782.         wsave
  7783.  
  7784.     DESCRIPTION
  7785.         Saves a region of the screen.
  7786.  
  7787.     SYNOPSIS
  7788.         #include "cxlwin.h"
  7789.         int *wsave(int srow,int scol,int erow,int ecol);
  7790.  
  7791.     INPUTS
  7792.         srow - start row
  7793.         scol - start column
  7794.         erow - end row
  7795.         ecol - end column
  7796.  
  7797.  
  7798.  
  7799.  
  7800.                                      124
  7801.  
  7802.  
  7803.     RETURN VALUE
  7804.         Address of newly created window buffer or NULL if a memory
  7805.         allocation error occurred.
  7806.  
  7807.     ALSO SEE
  7808.         ssave  videoinit  wintodisk  wrestore
  7809.  
  7810.     EXAMPLE
  7811.         int *wbuf;
  7812.         if((wbuf=wsave(10,10,20,40))==NULL)
  7813.             printf("Memory allocation error\n");
  7814.  
  7815.     ------------------------------------------------------------------------
  7816.  
  7817.     NAME
  7818.         wscanf
  7819.  
  7820.     DESCRIPTION
  7821.         Inputs a formatted string from keyboard.  Entered characters will
  7822.         echo to the active window in the attribute set by the wtextattr()
  7823.         function. Cursor position will be updated.  Works like the standard
  7824.         C library function scanf() does.  This function is only supported by
  7825.         the Turbo C version of CXL.
  7826.  
  7827.     SYNOPSIS
  7828.         #include "cxlwin.h"
  7829.         int wscanf(const char *format,...);
  7830.  
  7831.     INPUTS
  7832.         format - format string.  Refer to the section on scanf() in Turbo
  7833.                  C's run-time library reference manual.
  7834.         ...    - any additional arguments
  7835.  
  7836.     RETURN VALUE
  7837.         W_NOERROR  - no error
  7838.         W_NOACTIVE - no active window
  7839.  
  7840.     ALSO SEE
  7841.         wgetc  wgetns  wgets  winputsf  wtextattr
  7842.  
  7843.     ------------------------------------------------------------------------
  7844.  
  7845.     NAME
  7846.         wscroll
  7847.  
  7848.     DESCRIPTION
  7849.         Scrolls text lines within the active window, up or down.
  7850.  
  7851.     SYNOPSIS
  7852.         #include "cxlwin.h"
  7853.         int wscroll(int count,int direc);
  7854.  
  7855.     INPUTS
  7856.         count - number of lines to scroll
  7857.  
  7858.  
  7859.  
  7860.                                      125
  7861.  
  7862.  
  7863.         direc - scroll direction:
  7864.                     SUP   - scroll up
  7865.                     SDOWN - scroll down
  7866.  
  7867.     RETURN VALUE
  7868.         W_NOERROR  - no error
  7869.         W_NOACTIVE - no active window
  7870.  
  7871.     ALSO SEE
  7872.         wdelline  winsline  wscrollbox
  7873.  
  7874.     ------------------------------------------------------------------------
  7875.  
  7876.     NAME
  7877.         wscrollbox
  7878.  
  7879.     DESCRIPTION
  7880.         Scrolls a region of the active window up or down.
  7881.  
  7882.     SYNOPSIS
  7883.         #include "cxlwin.h"
  7884.         int wscrollbox(int wsrow,int wscol,int werow,int wecol,int count,
  7885.                        int direc);
  7886.  
  7887.     INPUTS
  7888.         wsrow - window start row
  7889.         wscol - window start column
  7890.         werow - window end row
  7891.         wecol - window end column
  7892.         count - number of lines to scroll
  7893.         direc - direction of scroll:
  7894.                     SUP -   scroll up
  7895.                     SDOWN - scroll down
  7896.  
  7897.     RETURN VALUE
  7898.         W_NOERROR  - no error
  7899.         W_NOACTIVE - no active window
  7900.  
  7901.     ALSO SEE
  7902.         wdelline  winsline  wscroll
  7903.  
  7904.     ------------------------------------------------------------------------
  7905.  
  7906.     NAME
  7907.         wselstr
  7908.  
  7909.     DESCRIPTION
  7910.         Allows user to select one string from an array of strings via an
  7911.         in-place "menu".  Provides Escape checking.
  7912.  
  7913.     SYNOPSIS
  7914.         #include "cxlwin.h"
  7915.         int wselstr(int wrow,int wcol,int attr,char *strarr[]);
  7916.  
  7917.  
  7918.  
  7919.  
  7920.                                      126
  7921.  
  7922.  
  7923.     INPUTS
  7924.         wrow   - window row to display selections at
  7925.         wcol   - window column to display selections at
  7926.         attr   - attribute for selection text
  7927.         strarr - the array of string (char *) pointers which to pick from.
  7928.                  The last pointer in the array MUST be NULL!
  7929.  
  7930.     RETURN VALUE
  7931.         The array subscript of the string which was selected.  If an error
  7932.         occurred, then -1 will be returned and _winfo.errno will be set to
  7933.         one of the following:
  7934.             W_NOACTIVE - no active window
  7935.             W_ESCPRESS - [Esc] key was pressed (if Escape checking was on)
  7936.  
  7937.     ALSO SEE
  7938.         wpickstr  wsetesc
  7939.  
  7940.     EXAMPLE
  7941.         int i;
  7942.         char *prn_ports[]= { "PRN","LPT1","LPT2","COM1","COM2",NULL };
  7943.         wprints(0,0,LCYAN|_BLUE,"Select printer:");
  7944.         i=wselstr(0,16,LMAGENTA|_BLUE,prn_ports);
  7945.         if(i!=-1) wprintf("You selected %s\n",prn_ports[i]);
  7946.  
  7947.     ------------------------------------------------------------------------
  7948.  
  7949.     NAME
  7950.         wsetesc
  7951.  
  7952.     DESCRIPTION
  7953.         Sets the Escape checking status for window keyboard input functions
  7954.         that utilize Escape checking.  By default, Escape checking is on.
  7955.  
  7956.     SYNOPSIS
  7957.         #include "cxlwin.h"
  7958.         void wsetesc(int option);
  7959.  
  7960.     INPUTS
  7961.         option - 0 = turn Escape checking off, 1 = turn Escape checking on
  7962.  
  7963.     ALSO SEE
  7964.         wgetchf  wgetns  winpread  winputsf  wmenuget  wpickfile  wpickstr
  7965.  
  7966.     ------------------------------------------------------------------------
  7967.  
  7968.     NAME
  7969.         wshadoff
  7970.  
  7971.     DESCRIPTION
  7972.         Removes the shadow from the active window, if one exists.  This
  7973.         function is only needed when you want to prematurely remove the
  7974.         active window's shadow.  The wclose() function automatically calls
  7975.         wshadoff() when it closes a window.
  7976.  
  7977.  
  7978.  
  7979.  
  7980.                                      127
  7981.  
  7982.  
  7983.     SYNOPSIS
  7984.         #include "cxlwin.h"
  7985.         int wshadoff(void);
  7986.  
  7987.     RETURN VALUE
  7988.         W_NOERROR  - no error
  7989.         W_NOACTIVE - no active window
  7990.  
  7991.     ALSO SEE
  7992.         wclose  wshadow
  7993.  
  7994.     ------------------------------------------------------------------------
  7995.  
  7996.     NAME
  7997.         wshadow
  7998.  
  7999.     DESCRIPTION
  8000.         Gives the active window a shadow.  The shadow will be cast to the
  8001.         right of the window and will be translucent (the characters
  8002.         underneath the shadow will show through in the given attribute).
  8003.  
  8004.     SYNOPSIS
  8005.         #include "cxlwin.h"
  8006.         int wshadow(int attr);
  8007.  
  8008.     INPUTS
  8009.         attr - attribute to use for the shadow and the characters underneath
  8010.                it. The most realistic looking shadow will be achieved using
  8011.                DGREY|_BLACK, but depending upon the contrast setting on your
  8012.                monitor, underlying characters may not be visible.  Several
  8013.                commercial programs use a shadow attribute of LGREY|_BLACK
  8014.                for this reason.
  8015.  
  8016.     RETURN VALUE
  8017.         W_NOERROR  - no error
  8018.         W_NOACTIVE - no active window
  8019.         W_ALLOCERR - memory allocation error
  8020.  
  8021.     ALSO SEE
  8022.         wshadoff
  8023.  
  8024.     EXAMPLE
  8025.         wshadow(DGREY|_BLACK);
  8026.  
  8027.     ------------------------------------------------------------------------
  8028.  
  8029.     NAME
  8030.         wsize
  8031.  
  8032.     DESCRIPTION
  8033.         Adjusts the size of the active window by changing the screen
  8034.         coordinates of its lower-right corner.
  8035.  
  8036.     SYNOPSIS
  8037.  
  8038.  
  8039.  
  8040.                                      128
  8041.  
  8042.  
  8043.         #include "cxlwin.h"
  8044.         int wsize(int nerow,int necol);
  8045.  
  8046.     INPUTS
  8047.         nerow - new end row of window
  8048.         necol - new end column of window
  8049.  
  8050.     RETURN VALUE
  8051.         W_NOERROR  - no error
  8052.         W_ALLOCERR - memory allocation error
  8053.         W_NOACTIVE - no active window
  8054.         W_INVCOORD - invalid coordinates
  8055.  
  8056.     ALSO SEE
  8057.         wcopy  wmove
  8058.  
  8059.     ------------------------------------------------------------------------
  8060.  
  8061.     NAME
  8062.         wtabwidth
  8063.  
  8064.     DESCRIPTION
  8065.         Modifies the tab width to be used when displaying tabs in the active
  8066.         window via the window TTY output functions.  The default tab width
  8067.         is 8.
  8068.  
  8069.     SYNOPSIS
  8070.         #include "cxlwin.h"
  8071.         void wtabwidth(int tabwidth);
  8072.  
  8073.     INPUTS
  8074.         tabwidth - the new tab width
  8075.  
  8076.     EXAMPLE
  8077.         wputs("\n\tHello, world");
  8078.         wtabwidth(4);
  8079.         wputs("\n\tHello, world");
  8080.  
  8081.     ------------------------------------------------------------------------
  8082.  
  8083.     NAME
  8084.         wtextattr
  8085.  
  8086.     DESCRIPTION
  8087.         Sets the current text attribute for the active window.  The current
  8088.         text attribute is used by the window TTY output functions for
  8089.         displaying text inside the active window.
  8090.  
  8091.     SYNOPSIS
  8092.         #include "cxlwin.h"
  8093.         int wtextattr(int attr);
  8094.  
  8095.     INPUTS
  8096.         attr - the new text attribute
  8097.  
  8098.  
  8099.  
  8100.                                      129
  8101.  
  8102.  
  8103.     RETURN VALUE
  8104.         W_NOERROR  - no error
  8105.         W_NOACTIVE - no active window
  8106.  
  8107.     ALSO SEE
  8108.         attrib  wchgattr
  8109.  
  8110.     EXAMPLE
  8111.         wtextattr(LCYAN|_GREEN|BLINK);
  8112.         wputs("Hello, world\n");
  8113.  
  8114.     ------------------------------------------------------------------------
  8115.  
  8116.     NAME
  8117.         wtitle
  8118.  
  8119.     DESCRIPTION
  8120.         Gives active window a title and displays title on top border line of
  8121.         window.  If active window has no border, then the window's record
  8122.         will be updated, but no title will be visible.
  8123.  
  8124.     SYNOPSIS
  8125.         #include "cxlwin.h"
  8126.         int wtitle(char *str,int tpos,int tattr);
  8127.  
  8128.     INPUTS
  8129.         str   - address of title string or NULL to delete title
  8130.         tpos  - title position.  If str==NULL then tpos is ignored.  Valid
  8131.                 tpos values are:
  8132.                     TLEFT   - left justified
  8133.                     TCENTER - centered
  8134.                     TRIGHT  - right justified
  8135.         tattr - attribute of window's title
  8136.  
  8137.     RETURN VALUE
  8138.         W_NOERROR  - no error
  8139.         W_NOACTIVE - no active window
  8140.         W_ALLOCERR - memory allocation error
  8141.  
  8142.     ALSO SEE
  8143.         wmessage
  8144.  
  8145.     EXAMPLE
  8146.         wtitle("[ My Window ]",TCENTER,YELLOW|_BROWN);
  8147.  
  8148.     ------------------------------------------------------------------------
  8149.  
  8150.     NAME
  8151.         wunhide
  8152.  
  8153.     DESCRIPTION
  8154.         Unhides a previously hidden window.  The unhidden window becomes the
  8155.         active window.
  8156.  
  8157.  
  8158.  
  8159.  
  8160.                                      130
  8161.  
  8162.  
  8163.     SYNOPSIS
  8164.         #include "cxlwin.h"
  8165.         int wunhide(WINDOW whandle);
  8166.  
  8167.     INPUTS
  8168.         whandle - the handle of the window to unhide.  If you want to unhide
  8169.                   the most recently hidden window, then specify 0.
  8170.  
  8171.     RETURN VALUE
  8172.         W_NOERROR  - no error
  8173.         W_ALLOCERR - memory allocation error
  8174.         W_NOTFOUND - window handle not found
  8175.         W_NOHIDDEN - no hidden windows
  8176.         W_NOTHIDD  - window not hidden
  8177.  
  8178.     ALSO SEE
  8179.         whide
  8180.  
  8181.     ------------------------------------------------------------------------
  8182.  
  8183.     NAME
  8184.         wvline
  8185.  
  8186.     DESCRIPTION
  8187.         "Draws" a vertical text line in the active window using characters
  8188.         defined by the given box type.  If the vertical line crosses a
  8189.         horizontal line of the same box type, an appropriate intersection or
  8190.         corner will be displayed.
  8191.  
  8192.     SYNOPSIS
  8193.         #include "cxlwin.h"
  8194.         int wvline(int wsrow,int wscol,int count,int btype,int attr);
  8195.  
  8196.     INPUTS
  8197.         wsrow - window start row
  8198.         wscol - window start column
  8199.         count - number of line characters to display
  8200.         btype - box type.  Can be one of the following:
  8201.                     0 - single line
  8202.                     1 - double line
  8203.                     2 - single horz, double vert line
  8204.                     3 - double horz, single vert line
  8205.                     4 - thick line
  8206.                     5 - uses spaces for line characters
  8207.         attr  - attribute to use for text line
  8208.  
  8209.     RETURN VALUE
  8210.         W_NOERROR  - no error
  8211.         W_NOACTIVE - no active window
  8212.         W_INVCOORD - entire text line could not fit in window
  8213.         W_INVBTYPE - invalid box type
  8214.  
  8215.     ALSO SEE
  8216.         whline
  8217.  
  8218.  
  8219.  
  8220.                                      131
  8221.  
  8222.  
  8223.     ------------------------------------------------------------------------
  8224.  
  8225.     NAME
  8226.         wwprints
  8227.  
  8228.     DESCRIPTION
  8229.         Prints a string to the specified window.  The specified window can
  8230.         be active, hidden, or blocked.  Control characters are not
  8231.         recognized. Cursor position is not updated.
  8232.  
  8233.     SYNOPSIS
  8234.         #include "cxlwin.h"
  8235.         int wwprints(WINDOW whandle,int wrow,int wcol,int attr,char *str);
  8236.  
  8237.     INPUTS
  8238.         whandle - handle of window to display to
  8239.         wrow    - window row to write string to
  8240.         wcol    - window column to write string to
  8241.         attr    - text attribute for written characters
  8242.         str     - address of string to display
  8243.  
  8244.     RETURN VALUE
  8245.         W_NOERROR  - no error
  8246.         W_NOACTIVE - no active window
  8247.         W_NOTFOUND - window handle not found
  8248.         W_INVCOORD - invalid window coordinates
  8249.         W_STRLONG  - string too long (not all of string was displayed)
  8250.  
  8251.     ALSO SEE
  8252.         wprints
  8253.  
  8254.  
  8255.  
  8256.  
  8257.  
  8258.  
  8259.  
  8260.  
  8261.  
  8262.  
  8263.  
  8264.  
  8265.  
  8266.  
  8267.  
  8268.  
  8269.  
  8270.  
  8271.  
  8272.  
  8273.  
  8274.  
  8275.  
  8276.  
  8277.  
  8278.  
  8279.  
  8280.                                      132
  8281.  
  8282.  
  8283.     Appendix A - Text Attribute Identifiers
  8284.  
  8285.  
  8286.          Foreground Colors                   Background Colors
  8287.  
  8288.         Identifier    Color                  Identifier    Color
  8289.         ----------    -----                  ----------    -----
  8290.         BLACK       - black                  _BLACK       - black
  8291.         BLUE        - blue                   _BLUE        - blue
  8292.         GREEN       - green                  _GREEN       - green
  8293.         CYAN        - cyan                   _CYAN        - cyan
  8294.         RED         - red                    _RED         - red
  8295.         MAGENTA     - magenta                _MAGENTA     - magenta
  8296.         BROWN       - brown                  _BROWN       - brown
  8297.         LGREY       - light grey             _LGREY       - light grey
  8298.         DGREY       - dark grey
  8299.         LBLUE       - light blue
  8300.         LGREEN      - light green
  8301.         LCYAN       - light cyan
  8302.         LRED        - light red
  8303.         LMAGENTA    - light magenta
  8304.         YELLOW      - yellow
  8305.         WHITE       - white
  8306.  
  8307.         BLINK       - blinking foreground
  8308.  
  8309.  
  8310.     Example Usage:
  8311.  
  8312.         BLINK|WHITE|_RED    -   blinking white on red
  8313.         YELLOW|_BLUE        -   yellow on blue
  8314.         LMAGENTA            -   light magenta on black
  8315.         _BLUE               -   black on blue
  8316.  
  8317.  
  8318.  
  8319.  
  8320.  
  8321.  
  8322.  
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328.  
  8329.  
  8330.  
  8331.  
  8332.  
  8333.  
  8334.  
  8335.  
  8336.  
  8337.  
  8338.  
  8339.  
  8340.                                      133
  8341.  
  8342.  
  8343.     Appendix B - Keycode Table
  8344.  
  8345.  
  8346.     Key             Norm        Shift       Ctrl        Alt
  8347.     ----            ----        -----       ----        ---
  8348.     A               1E61        1E41        1E01        1E00
  8349.     B               3062        3042        3002        3000
  8350.     C               2E63        2E42        2E03        2E00
  8351.     D               2064        2044        2004        2000
  8352.     E               1265        1245        1205        1200
  8353.     F               2166        2146        2106        2100
  8354.     G               2267        2247        2207        2200
  8355.     H               2368        2348        2308        2300
  8356.     I               1769        1749        1709        1700
  8357.     J               246A        244A        240A        2400
  8358.     K               256B        254B        250B        2500
  8359.     L               266C        264C        260C        2600
  8360.     M               326D        324D        320D        3200
  8361.     N               316E        314E        310E        3100
  8362.     O               186F        184F        180F        1800
  8363.     P               1970        1950        1910        1900
  8364.     Q               1071        1051        1011        1000
  8365.     R               1372        1352        1312        1300
  8366.     S               1F73        1F53        1F13        1F00
  8367.     T               1474        1454        1414        1400
  8368.     U               1675        1655        1615        1600
  8369.     V               2F76        2F56        2F16        2F00
  8370.     W               1177        1157        1117        1100
  8371.     X               2D78        2D58        2D18        2D00
  8372.     Y               1579        1559        1519        1500
  8373.     Z               2C7A        2C5A        2C1A        2C00
  8374.     1               0231        0221        N/A         7800
  8375.     2               0332        0340        0300        7900
  8376.     3               0433        0423        N/A         7A00
  8377.     4               0534        0524        N/A         7B00
  8378.     5               0635        0625        N/A         7C00
  8379.     6               0736        075E        071E        7D00
  8380.     7               0837        0826        N/A         7E00
  8381.     8               0938        092A        N/A         7F00
  8382.     9               0A39        0A28        N/A         8000
  8383.     0               0B30        0B29        N/A         8100
  8384.     ,               332C        333C        N/A         N/A
  8385.     .               342E        343E        N/A         N/A
  8386.     /               352F        353F        N/A         N/A
  8387.     ;               273B        273A        N/A         N/A
  8388.     '               2827        2822        N/A         N/A
  8389.     [               1A5B        1A7B        1A1B        N/A
  8390.     ]               1B5D        1B7D        1B1D        N/A
  8391.     `               2960        297E        N/A         N/A
  8392.     -               0C2D        0C5F        0C1F        8200
  8393.     =               0D3D        0D2B        N/A         8300
  8394.     \               2B5C        2B7C        2B1C        N/A
  8395.  
  8396.  
  8397.  
  8398.  
  8399.  
  8400.                                      134
  8401.  
  8402.  
  8403.     Key             Norm        Shift       Ctrl        Alt
  8404.     ----            ----        -----       ----        ---
  8405.     F1              3B00        5400        5E00        6800
  8406.     F2              3C00        5500        5F00        6900
  8407.     F3              3D00        5600        6000        6A00
  8408.     F4              3E00        5700        6100        6B00
  8409.     F5              3F00        5800        6200        6C00
  8410.     F6              4000        5900        6300        6D00
  8411.     F7              4100        5A00        6400        6E00
  8412.     F8              4200        5B00        6500        6F00
  8413.     F9              4300        5C00        6600        7000
  8414.     F10             4400        5D00        6700        7100
  8415.     Enter           1C0D        1C0D        1C0A        N/A
  8416.     Ins             5200        5230        N/A         N/A
  8417.     Del             5300        532E        N/A         N/A
  8418.     Esc             011B        011B        011B        N/A
  8419.     Home            4700        4737        7700        N/A
  8420.     End             4F00        4F31        7500        N/A
  8421.     PgUp            4900        4939        8400        N/A
  8422.     PgDn            5100        5133        7600        N/A
  8423.     <Tab>           0F09        0F00        N/A         N/A
  8424.     <BackSpace>     0E08        0E08        0E7F        N/A
  8425.     <LeftArrow>     4B00        4B34        7300        N/A
  8426.     <RightArrow>    4D00        4D36        7400        N/A
  8427.     <UpArrow>       4800        4838        N/A         N/A
  8428.     <DownArrow>     5000        5032        N/A         N/A
  8429.     <Keypad 5>      N/A         4C35        N/A         N/A
  8430.     <Grey *>        372A        N/A         7200        N/A
  8431.     <Grey ->        4A2D        4A2D        N/A         N/A
  8432.     <Grey +>        4E2B        4E2B        N/A         N/A
  8433.  
  8434.  
  8435.  
  8436.  
  8437.  
  8438.  
  8439.  
  8440.  
  8441.  
  8442.  
  8443.  
  8444.  
  8445.  
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.  
  8456.  
  8457.  
  8458.  
  8459.  
  8460.                                      135
  8461.  
  8462.  
  8463.     Appendix C - Window Output Escape Codes
  8464.  
  8465.  
  8466.     Escape Code         Function
  8467.     -----------         --------
  8468.         +           -   increase text attribute
  8469.         -           -   decrease text attribute
  8470.         A?          -   set text attribute to ?
  8471.         F?          -   set foreground text attribute to ?
  8472.         B?          -   set background text attribute to ?
  8473.         I           -   toggle intensity
  8474.         L           -   toggle blink
  8475.         X           -   reverse text attribute
  8476.         R?          -   set window row coordinate to ?
  8477.         C?          -   set window column coordinate to ?
  8478.         E?          -   erase ?:
  8479.                             W - entire window
  8480.                             L - to end-of-line
  8481.                             S - to end-of-window
  8482.         D??         -   display ? character ? times
  8483.  
  8484.  
  8485.     Window output Escape codes are only available in the window TTY output
  8486.     string functions.  Valid functions are wprintf(), wputs(), wputsw(), and
  8487.     others.  Also, the text inside help files can contain Escape codes
  8488.     (excluding cross-reference items).  The Escape code parameters MUST be
  8489.     character (byte) size.  Parameters should be input as binary.  For
  8490.     example, 5 would be '\005'.  If you are using them from inside a
  8491.     wprintf() format string, you can use the '%c' format specifier to supply
  8492.     the parameter from the list of variables.
  8493.  
  8494.     Example Usage:
  8495.  
  8496.         wprintf("\033A%cNormal \033IBright\033I \033LBlink\033L"
  8497.                 " \033XReverse\033X\n",CYAN|_BLUE);
  8498.         wprintf("\033R%c\033C%cRow %d, Col %d\n",3,5,3,5);
  8499.         wputs("\033DA\014 = 'A' 12 times\n");
  8500.  
  8501.  
  8502.  
  8503.  
  8504.  
  8505.  
  8506.  
  8507.  
  8508.  
  8509.  
  8510.  
  8511.  
  8512.  
  8513.  
  8514.  
  8515.  
  8516.  
  8517.  
  8518.  
  8519.  
  8520.                                      136
  8521.  
  8522.  
  8523.     Appendix D - Format Control Characters
  8524.  
  8525.      FCC                Description
  8526.      ---                -----------
  8527.       #         Allows numeric characters '0' thru '9'.
  8528.       %         Allows numeric characters '0' thru '9' and ' '.
  8529.       9         Allows numeric characters '0' thru '9', '.', '-', and '+'.
  8530.       ?         Allows any character.
  8531.       *         Allows any printable character.
  8532.       A         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  8533.       D         Allows date characters '0' thru '9', '-', and '/'.
  8534.       F         Allows legal MS-DOS filename characters.
  8535.       H         Allows hexadecimal characters '0' thru '9', 'A' thru 'F',
  8536.                 and 'a' thru 'f'.
  8537.       L         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  8538.                 Input letters will be converted to lowercase.
  8539.       M         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  8540.                 Input letters will be converted to mixed case
  8541.       P         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  8542.                 Input letters will be displayed as spaces, which is useful
  8543.                 for entering passwords.
  8544.       T         Allows telephone number characters '0' thru '9', '(', ')',
  8545.                 '-', and ' '.
  8546.       U         Allows alpha characters 'A' thru 'Z', 'a' thru 'z', and ' '.
  8547.                 Input letters will be converted to uppercase.
  8548.       W         Allows legal MS-DOS filename characters, including
  8549.                 wildcards.
  8550.       X         Allows alphanumeric characters 'A' thru 'Z', 'a' thru 'z',
  8551.                 '0' thru '9', and ' '.
  8552.       Y         Allows yes/no response characters 'Y', 'N', 'y', and 'n'.
  8553.  
  8554.       (space)   Space characters can be used throughout a format string to
  8555.                 improve its readability.
  8556.  
  8557.       <         Start of inclusion set.  An inclusion set allows you to
  8558.                 specify the only allowable characters for a position.
  8559.  
  8560.       >         End of inclusion set.  Any characters listed between the
  8561.                 left and right angle brackets are part of the set.
  8562.  
  8563.       [         Start of exclusion set.  An exclusion set allows you to
  8564.                 specify characters that aren't allowed in that position.
  8565.  
  8566.       ]         End of exclusion set.  Any characters listed between the
  8567.                 left and right square brackets are part of the set.
  8568.  
  8569.       '         Start or end of quoted text that will be displayed either in
  8570.                 the input field or as you are typing.  All characters in
  8571.                 between the start and end quotes will be displayed as text.
  8572.  
  8573.       "         Same as the single quote.  Is useful if you need to actually
  8574.                 display a single quote as text.  Note that in C, you must
  8575.                 represent the double quote inside the string as:  \"
  8576.  
  8577.  
  8578.  
  8579.  
  8580.                                      137
  8581.  
  8582.  
  8583.       !         Start and stop a command toggle sequence.  Any characters
  8584.                 in between the start and stop exclamation points are treated
  8585.                 as command toggles.  You can have as many command toggles
  8586.                 as you like between the exclamation points.  Valid command
  8587.                 toggles are listed below.  Command Toggles are valid with
  8588.                 inputsf() and winputsf() only!
  8589.  
  8590.     Command
  8591.     Toggle                    Description
  8592.     -------                   -----------
  8593.       -         Decreases text attribute.  Valid with winputsf() only.
  8594.       +         Increases text attribute.  Valid with winputsf() only.
  8595.       C         Toggles copying of quoted characters to receiving buffer.
  8596.                 The default is off.
  8597.       E         Toggles Escape checking.  When on, if Escape is pressed, the
  8598.                 receiving buffer will be emptied and an error code will be
  8599.                 returned.  The default for inputsf() is on. The default for
  8600.                 winputsf() is the value of the global variable _winfo.esc.
  8601.       L         Toggles lower-case conversion.  When on, all input letters
  8602.                 will be forced to lower-case.  The default is off.
  8603.       M         Toggles mixed-case conversion.  When on, input letters will
  8604.                 be forced to upper-case for the first letter of each word
  8605.                 and lower-case for the remaining letters.  The default is
  8606.                 off.
  8607.       P         Toggles password mode.  When on, input characters will be
  8608.                 echoed to the screen as spaces.  This is useful for password
  8609.                 fields.  The default is off.
  8610.       U         Toggles upper-case conversion.  When on, input letters will
  8611.                 be forced to upper-case.  The default is off.
  8612.  
  8613.     Examples:
  8614.  
  8615.     inputsf(name,"'Enter name:  ' !UR! XXXXX !R! XXXXXXXXXX");
  8616.  
  8617.     Prompts for name, inputs string from keyboard converting characters to
  8618.     uppercase as it goes, allows up to 15 alphanumeric characters as input.
  8619.     The return key is disabled until at least 5 characters have been
  8620.     entered.  Input characters will be copied to the receiving buffer, name,
  8621.     which must be large enough to hold all 16 characters - 15 for the input
  8622.     string, and one for the terminating '\0'.
  8623.  
  8624.  
  8625.     winputsf(phone," 'Enter phone:  '!RC! '(' ### ') ' ### '-' ####");
  8626.  
  8627.     Prompts for a full phone number including area code, allows only digit
  8628.     characters and displays format punctuation as it goes.  The entire field
  8629.     must be filled before return can be pressed.  All of the characters
  8630.     except the prompt will be copied to the receiving buffer, phone.  This
  8631.     buffer must be large enough to hold 15 characters - 10 for the phone
  8632.     number digits, 4 for the copied punctuation characters, and 1 for the
  8633.     terminating '\0'.
  8634.  
  8635.     winpdef( 1,16,date,"<01>#'/'<0123>#'/'<89>#",0,0,NULL,0);
  8636.  
  8637.  
  8638.  
  8639.  
  8640.                                      138
  8641.  
  8642.  
  8643.     Defines an input field that will accept a MMDDYY date.  Note the use of
  8644.     the inclusion set '<' and '>' characters to aid in allowing only valid
  8645.     numbers.  The receiving buffer, date, must be at least 7 characters to
  8646.     hold the 6 date characters and the terminating '\0'.
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653.  
  8654.  
  8655.  
  8656.  
  8657.  
  8658.  
  8659.  
  8660.  
  8661.  
  8662.  
  8663.  
  8664.  
  8665.  
  8666.  
  8667.  
  8668.  
  8669.  
  8670.  
  8671.  
  8672.  
  8673.  
  8674.  
  8675.  
  8676.  
  8677.  
  8678.  
  8679.  
  8680.  
  8681.  
  8682.  
  8683.  
  8684.  
  8685.  
  8686.  
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.  
  8693.  
  8694.  
  8695.  
  8696.  
  8697.  
  8698.  
  8699.  
  8700.                                      139
  8701.  
  8702.  
  8703.     Appendix E - Input Field Editing Keys
  8704.  
  8705.  
  8706.           Key                  Action
  8707.           ---                  ------
  8708.         LeftArrow             cursor left
  8709.         RightArrow            cursor right
  8710.         UpArrow               cursor up
  8711.         DownArrow             cursor down
  8712.         Ctrl-LeftArrow        word left
  8713.         Ctrl-RightArrow       word right
  8714.         Tab                   field right
  8715.         Shift-Tab             field left
  8716.         Enter                 process field
  8717.         Ctrl-Enter            process all fields
  8718.         Decimal (.)           move to right side of decimal point
  8719.         Home                  beginning of field
  8720.         End                   end of field line / end of field
  8721.         Ctrl-Home             beginning of first field
  8722.         Ctrl-End              end of last field
  8723.         Ins                   toggle field insert mode
  8724.         Del                   delete character at cursor
  8725.         BackSpace             delete character left
  8726.         Ctrl-BackSpace        delete word left
  8727.         Ctrl-R                restore field to original contents
  8728.         Ctrl-T                delete word right
  8729.         Ctrl-U                delete to end of field
  8730.         Ctrl-Y                delete to end of last field
  8731.         Esc                   abort data entry (if Escape checking is on)
  8732.  
  8733.  
  8734.  
  8735.  
  8736.  
  8737.  
  8738.  
  8739.  
  8740.  
  8741.  
  8742.  
  8743.  
  8744.  
  8745.  
  8746.  
  8747.  
  8748.  
  8749.  
  8750.  
  8751.  
  8752.  
  8753.  
  8754.  
  8755.  
  8756.  
  8757.                                      140
  8758.  
  8759.